ruby-changes:64633
From: Benoit <ko1@a...>
Date: Mon, 28 Dec 2020 01:39:14 +0900 (JST)
Subject: [ruby-changes:64633] 267bed0cd9 (master): Update to ruby/mspec@a40a674
https://git.ruby-lang.org/ruby.git/commit/?id=267bed0cd9 From 267bed0cd91711e2a8c79219e97431ba22137b01 Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Sun, 27 Dec 2020 17:35:30 +0100 Subject: Update to ruby/mspec@a40a674 diff --git a/spec/mspec/README.md b/spec/mspec/README.md index d4054bc..e334d56 100644 --- a/spec/mspec/README.md +++ b/spec/mspec/README.md @@ -53,7 +53,7 @@ To install the gem dependencies with Bundler, run the following: https://github.com/ruby/ruby/blob/trunk/spec/mspec/README.md#L53 ruby -S bundle install ``` -## Running Specs +## Development Use RSpec to run the MSpec specs. There are no plans currently to make the MSpec specs runnable by MSpec: https://github.com/ruby/mspec/issues/19. diff --git a/spec/mspec/lib/mspec/utils/script.rb b/spec/mspec/lib/mspec/utils/script.rb index e3478ef..5c6ae70 100644 --- a/spec/mspec/lib/mspec/utils/script.rb +++ b/spec/mspec/lib/mspec/utils/script.rb @@ -38,9 +38,7 @@ class MSpecScript https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/script.rb#L38 end def initialize - ruby_version_is ""..."2.5" do - abort "MSpec needs Ruby 2.5 or more recent" - end + check_version! config[:formatter] = nil config[:includes] = [] @@ -280,4 +278,10 @@ class MSpecScript https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/script.rb#L278 require 'mspec' script.run end + + private def check_version! + ruby_version_is ""..."2.5" do + warn "MSpec is supported for Ruby 2.5 and above only" + end + end end diff --git a/spec/mspec/lib/mspec/utils/warnings.rb b/spec/mspec/lib/mspec/utils/warnings.rb index 288dbe7..c770d60 100644 --- a/spec/mspec/lib/mspec/utils/warnings.rb +++ b/spec/mspec/lib/mspec/utils/warnings.rb @@ -1,9 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/warnings.rb#L1 require 'mspec/guards/version' # Always enable deprecation warnings when running MSpec, as ruby/spec tests for them, -# and like in most test frameworks, all warnings should be enabled by default (same as -w). +# and like in most test frameworks, deprecation warnings should be enabled by default, +# so that deprecations are noticed before the breaking change. +# Disable experimental warnings, we want to test new experimental features in ruby/spec. if Object.const_defined?(:Warning) and Warning.respond_to?(:[]=) Warning[:deprecated] = true + Warning[:experimental] = false end if Object.const_defined?(:Warning) and Warning.respond_to?(:warn) @@ -39,15 +42,6 @@ if Object.const_defined?(:Warning) and Warning.respond_to?(:warn) https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/warnings.rb#L42 when /passing a block to String#(bytes|chars|codepoints|lines) is deprecated/ when /core\/string\/modulo_spec\.rb:\d+: warning: too many arguments for format string/ when /regexp\/shared\/new_ascii(_8bit)?\.rb:\d+: warning: Unknown escape .+ is ignored/ - - # $VERBOSE = false warnings - when /constant ::(Fixnum|Bignum) is deprecated/ - when /\/(argf|io|stringio)\/.+(ARGF|IO)#(lines|chars|bytes|codepoints) is deprecated/ - when /Thread\.exclusive is deprecated.+\n.+thread\/exclusive_spec\.rb/ - when /hash\/shared\/index\.rb:\d+: warning: Hash#index is deprecated; use Hash#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 diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb index 93e0f53..7f3dc0e 100644 --- a/spec/mspec/tool/sync/sync-rubyspec.rb +++ b/spec/mspec/tool/sync/sync-rubyspec.rb @@ -1,3 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L1 +# This script is based on commands from the wiki: +# https://github.com/ruby/spec/wiki/Merging-specs-from-JRuby-and-other-sources + IMPLS = { truffleruby: { git: "https://github.com/oracle/truffleruby.git", @@ -173,7 +176,7 @@ def test_new_specs https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L176 versions = versions.grep(/^\d+\./) # Test on MRI min_version, max_version = versions.minmax - test_command = MSPEC ? "bundle exec rspec" : "../mspec/bin/mspec -j" + test_command = MSPEC ? "bundle install && bundle exec rspec" : "../mspec/bin/mspec -j" run_test = -> version { command = "chruby #{version} && #{test_command}" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/