From 2d21ca082e047d37287f01f760fadf9b331d082b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 2 Mar 2017 22:48:48 +0000 Subject: [PATCH] Ruby 2.4: Fixed "Fixnum is deprecated" warning in QueryTest. (#25048). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@16355 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/query_test.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index aced780f1..31a4ac2d3 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -32,6 +32,8 @@ class QueryTest < ActiveSupport::TestCase :workflows, :attachments + INTEGER_KLASS = RUBY_VERSION >= "2.4" ? Integer : Fixnum + def setup User.current = nil end @@ -1612,7 +1614,7 @@ class QueryTest < ActiveSupport::TestCase count_by_group = q.issue_count_by_group assert_kind_of Hash, count_by_group assert_equal %w(NilClass User), count_by_group.keys.collect {|k| k.class.name}.uniq.sort - assert_equal %w(Fixnum), count_by_group.values.collect {|k| k.class.name}.uniq + assert_equal %W(#{INTEGER_KLASS}), count_by_group.values.collect {|k| k.class.name}.uniq assert count_by_group.has_key?(User.find(3)) end @@ -1621,7 +1623,7 @@ class QueryTest < ActiveSupport::TestCase count_by_group = q.issue_count_by_group assert_kind_of Hash, count_by_group assert_equal %w(NilClass String), count_by_group.keys.collect {|k| k.class.name}.uniq.sort - assert_equal %w(Fixnum), count_by_group.values.collect {|k| k.class.name}.uniq + assert_equal %W(#{INTEGER_KLASS}), count_by_group.values.collect {|k| k.class.name}.uniq assert count_by_group.has_key?('MySQL') end @@ -1630,7 +1632,7 @@ class QueryTest < ActiveSupport::TestCase count_by_group = q.issue_count_by_group assert_kind_of Hash, count_by_group assert_equal %w(Date NilClass), count_by_group.keys.collect {|k| k.class.name}.uniq.sort - assert_equal %w(Fixnum), count_by_group.values.collect {|k| k.class.name}.uniq + assert_equal %W(#{INTEGER_KLASS}), count_by_group.values.collect {|k| k.class.name}.uniq end def test_issue_count_with_nil_group_only -- 2.39.5