|
|
72fb55 |
From c1ef236d12215484f40baede348a09622e4ac6e7 Mon Sep 17 00:00:00 2001
|
|
|
72fb55 |
From: Jun Aruga <jaruga@redhat.com>
|
|
|
72fb55 |
Date: Mon, 13 Feb 2017 23:44:34 +0100
|
|
|
72fb55 |
Subject: [PATCH] Suppress Fixnum/Bignum deprecated warnings for Ruby 2.4.0.
|
|
|
72fb55 |
|
|
|
72fb55 |
---
|
|
|
72fb55 |
test/cases/global_id_test.rb | 14 +++++++++-----
|
|
|
72fb55 |
1 file changed, 9 insertions(+), 5 deletions(-)
|
|
|
72fb55 |
|
|
|
72fb55 |
diff --git a/test/cases/global_id_test.rb b/test/cases/global_id_test.rb
|
|
|
72fb55 |
index 1ccde10..d80a8e5 100644
|
|
|
72fb55 |
--- a/test/cases/global_id_test.rb
|
|
|
72fb55 |
+++ b/test/cases/global_id_test.rb
|
|
|
72fb55 |
@@ -93,8 +93,10 @@ class GlobalIDCreationTest < ActiveSupport::TestCase
|
|
|
72fb55 |
end
|
|
|
72fb55 |
|
|
|
72fb55 |
test 'find with multiple class' do
|
|
|
72fb55 |
- assert_equal Person.find(@person_gid.model_id), @person_gid.find(only: [Fixnum, Person])
|
|
|
72fb55 |
- assert_equal Person.find(@person_uuid_gid.model_id), @person_uuid_gid.find(only: [Fixnum, Person])
|
|
|
72fb55 |
+ assert_equal Person.find(@person_gid.model_id),
|
|
|
72fb55 |
+ @person_gid.find(only: [0.class, Person])
|
|
|
72fb55 |
+ assert_equal Person.find(@person_uuid_gid.model_id),
|
|
|
72fb55 |
+ @person_uuid_gid.find(only: [0.class, Person])
|
|
|
72fb55 |
assert_equal PersonModel.find(@person_model_gid.model_id),
|
|
|
72fb55 |
@person_model_gid.find(only: [Float, PersonModel])
|
|
|
72fb55 |
assert_equal Person::Child.find(@person_namespaced_gid.model_id),
|
|
|
72fb55 |
@@ -102,8 +104,8 @@ class GlobalIDCreationTest < ActiveSupport::TestCase
|
|
|
72fb55 |
end
|
|
|
72fb55 |
|
|
|
72fb55 |
test 'find with multiple class no match' do
|
|
|
72fb55 |
- assert_nil @person_gid.find(only: [Fixnum, Numeric])
|
|
|
72fb55 |
- assert_nil @person_uuid_gid.find(only: [Fixnum, String])
|
|
|
72fb55 |
+ assert_nil @person_gid.find(only: [0.class, Numeric])
|
|
|
72fb55 |
+ assert_nil @person_uuid_gid.find(only: [0.class, String])
|
|
|
72fb55 |
assert_nil @person_model_gid.find(only: [Array, Hash])
|
|
|
72fb55 |
assert_nil @person_namespaced_gid.find(only: [String, Set])
|
|
|
72fb55 |
end
|
|
|
72fb55 |
@@ -111,8 +113,10 @@ class GlobalIDCreationTest < ActiveSupport::TestCase
|
|
|
72fb55 |
test 'find with multiple module' do
|
|
|
72fb55 |
assert_equal Person.find(@person_gid.model_id),
|
|
|
72fb55 |
@person_gid.find(only: [Enumerable, GlobalID::Identification])
|
|
|
72fb55 |
+ bignum_class = RUBY_VERSION >= '2.4' ? Integer : Bignum
|
|
|
72fb55 |
assert_equal Person.find(@person_uuid_gid.model_id),
|
|
|
72fb55 |
- @person_uuid_gid.find(only: [Bignum, GlobalID::Identification])
|
|
|
72fb55 |
+ @person_uuid_gid.find(only: [bignum_class,
|
|
|
72fb55 |
+ GlobalID::Identification])
|
|
|
72fb55 |
assert_equal PersonModel.find(@person_model_gid.model_id),
|
|
|
72fb55 |
@person_model_gid.find(only: [String, ActiveModel::Model])
|
|
|
72fb55 |
assert_equal Person::Child.find(@person_namespaced_gid.model_id),
|