mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/mspec@e171725
This commit is contained in:
parent
9c5a962354
commit
3eb0d50c0b
2 changed files with 5 additions and 8 deletions
|
@ -6,10 +6,8 @@ class PlatformGuard < SpecGuard
|
|||
case name
|
||||
when :rubinius
|
||||
RUBY_ENGINE.start_with?('rbx')
|
||||
when :ruby, :jruby, :truffleruby, :ironruby, :macruby, :maglev, :topaz, :opal
|
||||
RUBY_ENGINE.start_with?(name.to_s)
|
||||
else
|
||||
raise "unknown implementation #{name}"
|
||||
RUBY_ENGINE.start_with?(name.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -165,11 +165,10 @@ describe PlatformGuard, ".implementation?" do
|
|||
PlatformGuard.implementation?(:ruby).should == true
|
||||
end
|
||||
|
||||
it "raises an error when passed an unrecognized name" do
|
||||
stub_const 'RUBY_ENGINE', 'ruby'
|
||||
lambda {
|
||||
PlatformGuard.implementation?(:python)
|
||||
}.should raise_error(/unknown implementation/)
|
||||
it "works for an unrecognized name" do
|
||||
stub_const 'RUBY_ENGINE', 'myrubyimplementation'
|
||||
PlatformGuard.implementation?(:myrubyimplementation).should == true
|
||||
PlatformGuard.implementation?(:other).should == false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue