This commit is contained in:
Benoit Daloze 2020-12-27 17:35:30 +01:00
Родитель a042043487
Коммит 267bed0cd9
4 изменённых файлов: 16 добавлений и 15 удалений

Просмотреть файл

@ -53,7 +53,7 @@ To install the gem dependencies with Bundler, run the following:
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.

Просмотреть файл

@ -38,9 +38,7 @@ class MSpecScript
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
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

Просмотреть файл

@ -1,9 +1,12 @@
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)
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

Просмотреть файл

@ -1,3 +1,6 @@
# 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
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}"