diff --git a/.travis.yml b/.travis.yml index 0bb3f5d..be13055 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,11 @@ rvm: - 2.1 - 2.2 - 2.3.0 + - 2.4.0 + - 2.5.0 + - 2.6.0 + - 2.7.0 + - 3.0.0 - ruby-head before_install: diff --git a/CHANGELOG.md b/CHANGELOG.md index d41b0bd..a0972b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### v2.9.0 + +* Resolve Fixnum deprecation warnings with Ruby 2.4+ + +### v2.8.1 + +* Create shared CLI module + ### v2.8.0 * Add new diff-* executables for matching JSON & CSV files on the command line diff --git a/lib/diff_matcher/difference.rb b/lib/diff_matcher/difference.rb index 003e0d5..e52d3f2 100644 --- a/lib/diff_matcher/difference.rb +++ b/lib/diff_matcher/difference.rb @@ -53,7 +53,7 @@ def expected(e, actual) opts = expected_opts(e) size = opts[:size] case size - when Fixnum + when 0.class min = size max = size when Range diff --git a/lib/diff_matcher/version.rb b/lib/diff_matcher/version.rb index 0a1bbfc..c84294b 100644 --- a/lib/diff_matcher/version.rb +++ b/lib/diff_matcher/version.rb @@ -1,3 +1,3 @@ module DiffMatcher - VERSION = "2.8.1" + VERSION = "2.9.0" end diff --git a/spec/diff_matcher/difference_spec.rb b/spec/diff_matcher/difference_spec.rb index e9a0363..991d7de 100644 --- a/spec/diff_matcher/difference_spec.rb +++ b/spec/diff_matcher/difference_spec.rb @@ -42,8 +42,8 @@ def fix_EOF_problem(s) describe DiffMatcher::Matcher do expected, expected2, same, different, difference = - {:nombre => String , :edad => Integer }, - {:name => String , :age => Integer }, + {:nombre => String , :edad => 0.class }, + {:name => String , :age => 0.class }, {:name => "Peter" , :age => 21 }, {:name => 21 , :age => 21 }, "{\n :name=>\e[31m- \e[1mString\e[0m\e[33m+ \e[1m21\e[0m,\n :age=>\e[34m: \e[1m21\e[0m\n}\n" @@ -126,7 +126,7 @@ def fix_EOF_problem(s) subject { DiffMatcher::Matcher[expected].diff(actual, opts) } describe "when expected is an instance," do - context "of Fixnum," do + context "of Integer," do expected, same, different = 1, 1, @@ -140,7 +140,7 @@ def fix_EOF_problem(s) describe "when expected is an instance," do context "of Hash, with optional keys" do expected, same, different = - {:a=>1, :b=>Fixnum}, + {:a=>1, :b=>0.class}, {:a=>1}, {:a=>2} @@ -156,7 +156,7 @@ def fix_EOF_problem(s) subject { DiffMatcher::difference(expected, actual, opts) } describe "when expected is an instance," do - context "of Fixnum," do + context "of Integer," do expected, same, different = 1, 1, @@ -534,7 +534,7 @@ def description context "or-ed with another DiffMatcher::Matcher," do expected, same, different = - DiffMatcher::Matcher[Fixnum] | DiffMatcher::Matcher[String], + DiffMatcher::Matcher[0.class] | DiffMatcher::Matcher[String], "a", 1.0 @@ -635,7 +635,7 @@ def description context "a DiffMatcher::AllMatcher using an or-ed DiffMatcher::Matcher," do expected, same, different = - DiffMatcher::AllMatcher[ DiffMatcher::Matcher[Fixnum, Float] ], + DiffMatcher::AllMatcher[ DiffMatcher::Matcher[0.class, Float] ], [1, 2.0, 3], [1, "2", 3] @@ -653,8 +653,8 @@ def description expected, same, different = DiffMatcher::AllMatcher[ DiffMatcher::Matcher[ - {:nombre=>String, :edad=>Fixnum}, - {:name=>String, :age=>Fixnum} + {:nombre=>String, :edad=>0.class}, + {:name=>String, :age=>0.class} ] ], [ @@ -674,7 +674,7 @@ def description | {:name=>"Alice", :age=>10}, { :name=>: "Bob", - :age=>- Fixnum+ nil + :age=>- 0.class+ nil }, | {:nombre=>"Con", :edad=>30} ] @@ -698,7 +698,7 @@ def description end end expected, same, different = - [ 1, 2, /\d/, Fixnum, 4..6 , lambda { |x| x % 6 == 0 }, matchable.new(7)], + [ 1, 2, /\d/, 0.class, 4..6 , lambda { |x| x % 6 == 0 }, matchable.new(7)], [ 1, 2, "3" , 4 , 5 , 6 , 7 ], [ 0, 2, "3" , 4 , 5 , 6 , 7 ]