ruby-changes:59869
From: Benoit <ko1@a...>
Date: Wed, 29 Jan 2020 04:48:49 +0900 (JST)
Subject: [ruby-changes:59869] ed377cc9aa (master): Update to ruby/mspec@9bce874
https://git.ruby-lang.org/ruby.git/commit/?id=ed377cc9aa From ed377cc9aaf1ccbede19ddc6c464f5fbf3cabc34 Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Tue, 28 Jan 2020 20:47:46 +0100 Subject: Update to ruby/mspec@9bce874 diff --git a/spec/mspec/lib/mspec/runner/context.rb b/spec/mspec/lib/mspec/runner/context.rb index 5f6c9c8..d55b0dc 100644 --- a/spec/mspec/lib/mspec/runner/context.rb +++ b/spec/mspec/lib/mspec/runner/context.rb @@ -28,6 +28,7 @@ class ContextState https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/context.rb#L28 @pre = {} @post = {} @examples = [] + @state = nil @parent = nil @parents = [self] @children = [] @@ -127,6 +128,7 @@ class ContextState https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/context.rb#L128 # Creates an ExampleState instance for the block and stores it # in a list of examples to evaluate unless the example is filtered. def it(desc, &block) + raise "nested #it" if @state example = ExampleState.new(self, desc, block) MSpec.actions :add, example return if MSpec.guarded? diff --git a/spec/mspec/lib/mspec/utils/warnings.rb b/spec/mspec/lib/mspec/utils/warnings.rb index 7c2bc6f..1cf83b6 100644 --- a/spec/mspec/lib/mspec/utils/warnings.rb +++ b/spec/mspec/lib/mspec/utils/warnings.rb @@ -16,6 +16,10 @@ if RUBY_ENGINE == "ruby" and ruby_version_is("2.4") https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/warnings.rb#L16 end def Warning.warn(message) + # Suppress any warning inside the method to prevent recursion + verbose = $VERBOSE + $VERBOSE = nil + if Thread.current[:in_mspec_complain_matcher] return $stderr.write(message) end @@ -52,9 +56,12 @@ if RUBY_ENGINE == "ruby" and ruby_version_is("2.4") https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/warnings.rb#L56 when /env\/shared\/key\.rb:\d+: warning: ENV\.index is deprecated; use ENV\.key/ when /exponent(_spec)?\.rb:\d+: warning: in a\*\*b, b may be too big/ when /enumerator\/(new_spec|initialize_spec)\.rb:\d+: warning: Enumerator\.new without a block is deprecated/ + when /Pattern matching is experimental, and the behavior may change in future versions of Ruby!/ else $stderr.write message end + ensure + $VERBOSE = verbose end else $VERBOSE = nil unless ENV['OUTPUT_WARNINGS'] diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb index 74881c1..d782774 100644 --- a/spec/mspec/tool/sync/sync-rubyspec.rb +++ b/spec/mspec/tool/sync/sync-rubyspec.rb @@ -157,7 +157,8 @@ end https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L157 def test_new_specs require "yaml" Dir.chdir(SOURCE_REPO) do - versions = YAML.load_file("#{MSPEC_REPO}/.travis.yml").fetch("rvm") + workflow = YAML.load_file(".github/workflows/ci.yml") + versions = workflow.dig("jobs", "test", "strategy", "matrix", "ruby") versions = versions.grep(/^\d+\./) # Test on MRI min_version, max_version = versions.minmax -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/