summaryrefslogtreecommitdiff
path: root/spec/mspec/lib/mspec/guards/platform.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/lib/mspec/guards/platform.rb')
-rw-r--r--spec/mspec/lib/mspec/guards/platform.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/mspec/lib/mspec/guards/platform.rb b/spec/mspec/lib/mspec/guards/platform.rb
index 875aef6c9c..96176b8753 100644
--- a/spec/mspec/lib/mspec/guards/platform.rb
+++ b/spec/mspec/lib/mspec/guards/platform.rb
@@ -5,9 +5,9 @@ class PlatformGuard < SpecGuard
args.any? do |name|
case name
when :rubinius
- RUBY_NAME.start_with?('rbx')
+ RUBY_ENGINE.start_with?('rbx')
when :ruby, :jruby, :truffleruby, :ironruby, :macruby, :maglev, :topaz, :opal
- RUBY_NAME.start_with?(name.to_s)
+ RUBY_ENGINE.start_with?(name.to_s)
else
raise "unknown implementation #{name}"
end
@@ -67,12 +67,10 @@ class PlatformGuard < SpecGuard
end
end
-class Object
- def platform_is(*args, &block)
- PlatformGuard.new(*args).run_if(:platform_is, &block)
- end
+def platform_is(*args, &block)
+ PlatformGuard.new(*args).run_if(:platform_is, &block)
+end
- def platform_is_not(*args, &block)
- PlatformGuard.new(*args).run_unless(:platform_is_not, &block)
- end
+def platform_is_not(*args, &block)
+ PlatformGuard.new(*args).run_unless(:platform_is_not, &block)
end