[DRE-commits] [ruby-enumerize] 01/05: rename variable in test to avoid conflict with minitest method (Closes: #794170)
Cédric Boutillier
boutil at moszumanska.debian.org
Wed Aug 12 12:24:13 UTC 2015
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository ruby-enumerize.
commit 4da55873fb5421fcd2bf003b9afdae8a4f88a66d
Author: Cédric Boutillier <boutil at debian.org>
Date: Wed Aug 12 14:11:58 2015 +0200
rename variable in test to avoid conflict with minitest method (Closes: #794170)
---
debian/patches/no_test_value.patch | 161 +++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 162 insertions(+)
diff --git a/debian/patches/no_test_value.patch b/debian/patches/no_test_value.patch
new file mode 100644
index 0000000..6c35705
--- /dev/null
+++ b/debian/patches/no_test_value.patch
@@ -0,0 +1,161 @@
+Description: rename the value variable to avoid conflict with minitest method
+Bug: https://github.com/brainspec/enumerize/issues/202
+Bug-Debian: http://bugs.debian.org/794170
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2015-08-12
+
+--- a/test/value_test.rb
++++ b/test/value_test.rb
+@@ -3,26 +3,26 @@
+
+ describe Enumerize::Value do
+ let(:attr) { Struct.new(:values).new([]) }
+- let(:value) { Enumerize::Value.new(attr, 'test_value', 1) }
++ let(:val) { Enumerize::Value.new(attr, 'test_value', 1) }
+
+ it 'is a string' do
+- value.must_be_kind_of String
++ val.must_be_kind_of String
+ end
+
+ describe 'equality' do
+ it 'is compared to string' do
+- value.must_be :==, 'test_value'
+- value.wont_be :==, 'not_value'
++ val.must_be :==, 'test_value'
++ val.wont_be :==, 'not_value'
+ end
+
+ it 'is compared to symbol' do
+- value.must_be :==, :test_value
+- value.wont_be :==, :not_value
++ val.must_be :==, :test_value
++ val.wont_be :==, :not_value
+ end
+
+ it 'is compared to integer' do
+- value.must_be :==, 1
+- value.wont_be :==, 2
++ val.must_be :==, 1
++ val.wont_be :==, 2
+ end
+ end
+
+@@ -31,13 +31,13 @@
+
+ it 'uses common translation' do
+ store_translations(:en, :enumerize => {:attribute_name => {:test_value => "Common translation"}}) do
+- value.text.must_be :==, "Common translation"
++ val.text.must_be :==, "Common translation"
+ end
+ end
+
+ it 'uses default translation from the "default" section if its present' do
+ store_translations(:en, :enumerize => {:defaults => {:attribute_name => {:test_value => "Common translation"}}}) do
+- value.text.must_be :==, "Common translation"
++ val.text.must_be :==, "Common translation"
+ end
+ end
+
+@@ -45,7 +45,7 @@
+ attr.i18n_scopes = ["enumerize.model_name.attribute_name"]
+
+ store_translations(:en, :enumerize => {:model_name => {:attribute_name => {:test_value => "Model Specific translation"}}}) do
+- value.text.must_be :==, "Model Specific translation"
++ val.text.must_be :==, "Model Specific translation"
+ end
+ end
+
+@@ -53,13 +53,13 @@
+ attr.i18n_scopes = ["enumerize.model_name.attribute_name"]
+
+ store_translations(:en, :enumerize => {:attribute_name => {:test_value => "Common translation"}, :model_name => {:attribute_name => {:test_value => "Model Specific translation"}}}) do
+- value.text.must_be :==, "Model Specific translation"
++ val.text.must_be :==, "Model Specific translation"
+ end
+ end
+
+ it 'uses simply humanized value when translation is undefined' do
+ store_translations(:en, :enumerize => {}) do
+- value.text.must_be :==, "Test value"
++ val.text.must_be :==, "Test value"
+ end
+ end
+
+@@ -67,7 +67,7 @@
+ attr.i18n_scopes = ["other.scope"]
+
+ store_translations(:en, :other => {:scope => {:test_value => "Scope specific translation"}}) do
+- value.text.must_be :==, "Scope specific translation"
++ val.text.must_be :==, "Scope specific translation"
+ end
+ end
+
+@@ -75,55 +75,55 @@
+ attr.i18n_scopes = ["nonexistent.scope", "other.scope"]
+
+ store_translations(:en, :other => {:scope => {:test_value => "Scope specific translation"}}) do
+- value.text.must_be :==, "Scope specific translation"
++ val.text.must_be :==, "Scope specific translation"
+ end
+ end
+ end
+
+ describe 'boolean methods comparison' do
+ before do
+- attr.values = [value, Enumerize::Value.new(attr, 'other_value')]
++ attr.values = [val, Enumerize::Value.new(attr, 'other_value')]
+ end
+
+ it 'returns true if value equals method' do
+- value.test_value?.must_equal true
++ val.test_value?.must_equal true
+ end
+
+ it 'returns false if value does not equal method' do
+- value.other_value?.must_equal false
++ val.other_value?.must_equal false
+ end
+
+ it 'raises NoMethodError if there are no values like boolean method' do
+ proc {
+- value.some_method?
++ val.some_method?
+ }.must_raise NoMethodError
+ end
+
+ it 'raises ArgumentError if arguments are passed' do
+ proc {
+- value.other_value?('<3')
++ val.other_value?('<3')
+ }.must_raise ArgumentError
+ end
+
+ it 'responds to methods for existing values' do
+- value.must_respond_to :test_value?
+- value.must_respond_to :other_value?
++ val.must_respond_to :test_value?
++ val.must_respond_to :other_value?
+ end
+
+ it 'returns a method object' do
+- value.method(:test_value?).must_be_instance_of Method
++ val.method(:test_value?).must_be_instance_of Method
+ end
+
+ it "doesn't respond to a method for not existing value" do
+- value.wont_respond_to :some_method?
++ val.wont_respond_to :some_method?
+ end
+ end
+
+ describe 'serialization' do
+- let(:value) { Enumerize::Value.new(attr, 'test_value') }
++ let(:val) { Enumerize::Value.new(attr, 'test_value') }
+
+ it 'should be serialized to yaml as string value' do
+- assert_equal YAML.dump('test_value'), YAML.dump(value)
++ assert_equal YAML.dump('test_value'), YAML.dump(val)
+ end
+ end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index fc3a9e0..d3bd311 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
disable_some_tests.patch
+no_test_value.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-enumerize.git
More information about the Pkg-ruby-extras-commits
mailing list