diff options
Diffstat (limited to 'spec/mspec/lib/mspec/guards')
-rw-r--r-- | spec/mspec/lib/mspec/guards/platform.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/mspec/lib/mspec/guards/platform.rb b/spec/mspec/lib/mspec/guards/platform.rb index 9543b1dd05..c69401ea39 100644 --- a/spec/mspec/lib/mspec/guards/platform.rb +++ b/spec/mspec/lib/mspec/guards/platform.rb @@ -18,20 +18,20 @@ class PlatformGuard < SpecGuard implementation? :ruby end - HOST_OS = begin + PLATFORM = if RUBY_ENGINE == "jruby" require 'rbconfig' - RbConfig::CONFIG['host_os'] || RUBY_PLATFORM - rescue LoadError + "#{RbConfig::CONFIG['host_cpu']}-#{RbConfig::CONFIG['host_os']}" + else RUBY_PLATFORM - end.downcase + end def self.os?(*oses) oses.any? do |os| raise ":java is not a valid OS" if os == :java if os == :windows - HOST_OS =~ /(mswin|mingw)/ + PLATFORM =~ /(mswin|mingw)/ else - HOST_OS.include?(os.to_s) + PLATFORM.include?(os.to_s) end end end |