From 7043b6f3a1a3f8183f50deb3122249166b3dd24a Mon Sep 17 00:00:00 2001 From: Vít Ondruch Date: Jan 24 2017 09:27:19 +0000 Subject: Fix unstable ReflectionTest#test_read_attribute_names test. --- diff --git a/activerecord-5.0.1-Creating-a-new-Topic-class-instead-of-class_eval.patch b/activerecord-5.0.1-Creating-a-new-Topic-class-instead-of-class_eval.patch new file mode 100644 index 0000000..5e6d5a5 --- /dev/null +++ b/activerecord-5.0.1-Creating-a-new-Topic-class-instead-of-class_eval.patch @@ -0,0 +1,36 @@ +From be9dc78fccc80bb5045c67b435b5c7e36ea8a296 Mon Sep 17 00:00:00 2001 +From: Yasuo Honda +Date: Thu, 11 Aug 2016 11:26:20 +0000 +Subject: [PATCH] Creating a new Topic class instead of class_eval for the + existing one since it affects another test + `ReflectionTest#test_read_attribute_names` + +Address #26099 +--- + activerecord/test/cases/validations_test.rb | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb +index 76510cb..5d9aa99 100644 +--- a/activerecord/test/cases/validations_test.rb ++++ b/activerecord/test/cases/validations_test.rb +@@ -156,17 +156,15 @@ def test_validators + end + + def test_numericality_validation_with_mutation +- Topic.class_eval do ++ klass = Class.new(Topic) do + attribute :wibble, :string + validates_numericality_of :wibble, only_integer: true + end + +- topic = Topic.new(wibble: '123-4567') ++ topic = klass.new(wibble: "123-4567") + topic.wibble.gsub!('-', '') + + assert topic.valid? +- ensure +- Topic.reset_column_information + end + + def test_acceptance_validator_doesnt_require_db_connection diff --git a/rubygem-activerecord.spec b/rubygem-activerecord.spec index 4dc10be..f9b4c73 100644 --- a/rubygem-activerecord.spec +++ b/rubygem-activerecord.spec @@ -4,7 +4,7 @@ Name: rubygem-%{gem_name} Epoch: 1 Version: 5.0.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Object-relational mapper framework (part of Rails) Group: Development/Languages License: MIT @@ -19,6 +19,10 @@ Source1: activerecord-%{version}-tests.tgz # https://github.com/rails/rails/pull/26732 Patch0: rubygem-activerecord-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk.patch +# Fix unstable ReflectionTest#test_read_attribute_names test. +# https://github.com/rails/rails/pull/26124 +Patch1: activerecord-5.0.1-Creating-a-new-Topic-class-instead-of-class_eval.patch + # Database dump/load reuires the executable. Suggests: %{_bindir}/sqlite3 BuildRequires: rubygems-devel @@ -72,6 +76,7 @@ pushd .%{gem_instdir} tar xzvf %{SOURCE1} patch -p2 < %{PATCH0} +patch -p2 < %{PATCH1} # Disable unstable tests. # https://github.com/rails/rails/issues/25774 @@ -122,6 +127,9 @@ popd %{gem_instdir}/examples %changelog +* Tue Jan 24 2017 Vít Ondruch - 1:5.0.1-2 +- Fix unstable ReflectionTest#test_read_attribute_names test. + * Mon Jan 02 2017 Pavel Valena - 1:5.0.1-1 - Update to Active Record 5.0.1. - Fix warnings: Fixnum and Bignum are deprecated in Ruby trunk