summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/mspec/.travis.yml13
-rw-r--r--spec/mspec/lib/mspec/guards/platform.rb17
2 files changed, 26 insertions, 4 deletions
diff --git a/spec/mspec/.travis.yml b/spec/mspec/.travis.yml
index 73f141d2ae..d942de3d21 100644
--- a/spec/mspec/.travis.yml
+++ b/spec/mspec/.travis.yml
@@ -7,10 +7,17 @@ script:
- bundle exec rspec
matrix:
include:
- - rvm: 2.2.8
- - rvm: 2.3.5
- - rvm: 2.4.2
+ - rvm: 2.2.9
+ - rvm: 2.3.6
+ - rvm: 2.4.3
+ - rvm: 2.5.0
+ before_install:
+ # https://github.com/travis-ci/travis-ci/issues/8978
+ - gem update --system
- rvm: ruby-head
+ before_install:
+ # https://github.com/travis-ci/travis-ci/issues/8978
+ - gem update --system
- jdk: oraclejdk8
install:
- curl -L https://github.com/graalvm/truffleruby/releases/download/vm-enterprise-0.28/truffleruby-testing-0.28.tar.gz | tar xz
diff --git a/spec/mspec/lib/mspec/guards/platform.rb b/spec/mspec/lib/mspec/guards/platform.rb
index 96176b8753..9543b1dd05 100644
--- a/spec/mspec/lib/mspec/guards/platform.rb
+++ b/spec/mspec/lib/mspec/guards/platform.rb
@@ -40,8 +40,21 @@ class PlatformGuard < SpecGuard
os?(:windows)
end
+ WORD_SIZE = 1.size * 8
+
+ POINTER_SIZE = begin
+ require 'rbconfig/sizeof'
+ RbConfig::SIZEOF["void*"] * 8
+ rescue LoadError
+ WORD_SIZE
+ end
+
def self.wordsize?(size)
- size == 8 * 1.size
+ size == WORD_SIZE
+ end
+
+ def self.pointer_size?(size)
+ size == POINTER_SIZE
end
def initialize(*args)
@@ -61,6 +74,8 @@ class PlatformGuard < SpecGuard
match &&= PlatformGuard.os?(*value)
when :wordsize
match &&= PlatformGuard.wordsize? value
+ when :pointer_size
+ match &&= PlatformGuard.pointer_size? value
end
end
match