diff --git a/.travis.yml b/.travis.yml index c98d274..d696151 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: ruby rvm: + - 2.4.0 + - 2.3.3 - 2.2.0 - 2.1.5 - 2.1.4 @@ -14,6 +16,12 @@ jdk: # for JRuby only - oraclejdk8 matrix: exclude: + - rvm: 2.4.0 + jdk: openjdk7 + jdk: oraclejdk8 + - rvm: 2.3.3 + jdk: openjdk7 + jdk: oraclejdk8 - rvm: 2.2.0 jdk: openjdk7 jdk: oraclejdk8 @@ -40,4 +48,4 @@ matrix: - rvm: jruby-head - rvm: 1.9.3 -script: "rake test" +script: "bundle exec rake test" diff --git a/Gemfile b/Gemfile index 2ad2b76..e5cb94c 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ gemspec group :development, :test do gem 'rspec', '~> 3.2.0' gem 'simplecov', '~> 0.9.2', :require => false + gem 'tins', '~> 1.10.2', :require => false gem 'coveralls', '~> 0.7.11', :require => false end diff --git a/lib/thread_safe/cache.rb b/lib/thread_safe/cache.rb index 109cb98..265c0e5 100644 --- a/lib/thread_safe/cache.rb +++ b/lib/thread_safe/cache.rb @@ -150,8 +150,8 @@ def populate_from(hash) end def validate_options_hash!(options) - if (initial_capacity = options[:initial_capacity]) && (!initial_capacity.kind_of?(Fixnum) || initial_capacity < 0) - raise ArgumentError, ":initial_capacity must be a positive Fixnum" + if (initial_capacity = options[:initial_capacity]) && (!initial_capacity.kind_of?(0.class) || initial_capacity < 0) + raise ArgumentError, ":initial_capacity must be a positive #{0.class}" end if (load_factor = options[:load_factor]) && (!load_factor.kind_of?(Numeric) || load_factor <= 0 || load_factor > 1) raise ArgumentError, ":load_factor must be a number between 0 and 1" diff --git a/thread_safe.gemspec b/thread_safe.gemspec index 5e6aba1..cf3faeb 100644 --- a/thread_safe.gemspec +++ b/thread_safe.gemspec @@ -21,6 +21,6 @@ Gem::Specification.new do |gem| gem.license = "Apache-2.0" gem.add_development_dependency 'atomic', '= 1.1.16' - gem.add_development_dependency 'rake' + gem.add_development_dependency 'rake', '< 12.0' gem.add_development_dependency 'rspec', '~> 3.2' end