Skip to content

Commit

Permalink
Merge pull request #40 from sue445/feature/fix_deprecation_warning
Browse files Browse the repository at this point in the history
Fix deprecation warning on ruby 2.4.0
  • Loading branch information
joker1007 authored Dec 26, 2016
2 parents a05e2af + ab432c7 commit dd202ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sudo: false
rvm:
- 2.2
- 2.3.0
- 2.4.0
- ruby-head

gemfile:
Expand Down
16 changes: 11 additions & 5 deletions lib/rspec/parameterized/table_syntax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ module TableSyntax
include TableSyntaxImplement
end

refine Fixnum do
include TableSyntaxImplement
end
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("2.4.0")
refine Integer do
include TableSyntaxImplement
end
else
refine Fixnum do
include TableSyntaxImplement
end

refine Bignum do
include TableSyntaxImplement
refine Bignum do
include TableSyntaxImplement
end
end

refine Array do
Expand Down
2 changes: 1 addition & 1 deletion rspec-parameterized.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ I was inspired by [udzura's mock](https://gist.github.com/1881139).}
gem.add_dependency('unparser')
gem.add_dependency('proc_to_ast')
gem.add_dependency('binding_of_caller')
gem.add_development_dependency('rake')
gem.add_development_dependency('rake', '< 12.0.0')

gem.files = `git ls-files`.split($\)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Expand Down
2 changes: 2 additions & 0 deletions spec/parametarized_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
1 | 2 | 3
"hello " | "world" | "hello world"
[1, 2, 3] | [4, 5, 6] | [1, 2, 3, 4, 5, 6]
100000000000000000000 | 100000000000000000000 | 200000000000000000000
end

with_them do
Expand All @@ -90,6 +91,7 @@
1 | 2 | -> { eq(3) }
"hello " | "world" | -> { eq("hello world") }
[1, 2, 3] | [4, 5, 6] | -> { be_a(Array) }
100000000000000000000 | 100000000000000000000 | -> { eq(200000000000000000000) }
end

with_them do
Expand Down

0 comments on commit dd202ee

Please sign in to comment.