summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/mspec/lib/mspec/guards/platform.rb4
-rw-r--r--spec/mspec/spec/guards/platform_spec.rb9
2 files changed, 5 insertions, 8 deletions
diff --git a/spec/mspec/lib/mspec/guards/platform.rb b/spec/mspec/lib/mspec/guards/platform.rb
index c69401ea39..2d22d4fb59 100644
--- a/spec/mspec/lib/mspec/guards/platform.rb
+++ b/spec/mspec/lib/mspec/guards/platform.rb
@@ -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
diff --git a/spec/mspec/spec/guards/platform_spec.rb b/spec/mspec/spec/guards/platform_spec.rb
index ad1e3695ca..6088fb2ba6 100644
--- a/spec/mspec/spec/guards/platform_spec.rb
+++ b/spec/mspec/spec/guards/platform_spec.rb
@@ -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