aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-10 05:12:50 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-10 05:12:50 +0000
commit83b0204138a178d0e24e3d9aec454dd283a5185e (patch)
treec880bc27290a8124800f366c91dcaf26ad3c8034
parent73673256ac4d49bc011c082ce77c31a041222478 (diff)
downloadrails-83b0204138a178d0e24e3d9aec454dd283a5185e.tar.gz
rails-83b0204138a178d0e24e3d9aec454dd283a5185e.tar.bz2
rails-83b0204138a178d0e24e3d9aec454dd283a5185e.zip
Ruby 1.9 compat. References #1689 [Pratik Naik]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8363 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activesupport/test/core_ext/class/delegating_attributes_test.rb6
-rw-r--r--activesupport/test/core_ext/enumerable_test.rb2
-rw-r--r--activesupport/test/ordered_options_test.rb6
3 files changed, 9 insertions, 5 deletions
diff --git a/activesupport/test/core_ext/class/delegating_attributes_test.rb b/activesupport/test/core_ext/class/delegating_attributes_test.rb
index 59c0a6f63c..f5b14364cf 100644
--- a/activesupport/test/core_ext/class/delegating_attributes_test.rb
+++ b/activesupport/test/core_ext/class/delegating_attributes_test.rb
@@ -25,7 +25,7 @@ class DelegatingAttributesTest < Test::Unit::TestCase
# The class and instance should have an accessor, but there
# should be no mutator
assert single_class.respond_to?(:only_reader)
- assert single_class.public_instance_methods.include?("only_reader")
+ assert single_class.public_instance_methods.map(&:to_s).include?("only_reader")
assert !single_class.respond_to?(:only_reader=)
end
@@ -45,8 +45,8 @@ class DelegatingAttributesTest < Test::Unit::TestCase
# the instance should have an accessor only
assert single_class.respond_to?(:both)
assert single_class.respond_to?(:both=)
- assert single_class.public_instance_methods.include?("both")
- assert !single_class.public_instance_methods.include?("both=")
+ assert single_class.public_instance_methods.map(&:to_s).include?("both")
+ assert !single_class.public_instance_methods.map(&:to_s).include?("both=")
end
def test_working_with_simple_attributes
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb
index 0ff2eb1c81..af183dace3 100644
--- a/activesupport/test/core_ext/enumerable_test.rb
+++ b/activesupport/test/core_ext/enumerable_test.rb
@@ -37,7 +37,7 @@ class EnumerableTests < Test::Unit::TestCase
end
def test_nil_sums
- expected_raise = RUBY_VERSION < '1.9.0' ? TypeError : NoMethodError
+ expected_raise = TypeError
assert_raise(expected_raise) { [5, 15, nil].sum }
diff --git a/activesupport/test/ordered_options_test.rb b/activesupport/test/ordered_options_test.rb
index f8ef645e37..bf7339ac57 100644
--- a/activesupport/test/ordered_options_test.rb
+++ b/activesupport/test/ordered_options_test.rb
@@ -4,7 +4,11 @@ class OrderedHashTest < Test::Unit::TestCase
def setup
@keys = %w( blue green red pink orange )
@values = %w( 000099 009900 aa0000 cc0066 cc6633 )
- @ordered_hash = ActiveSupport::OrderedHash.new(@keys.zip(@values).to_a)
+ @ordered_hash = ActiveSupport::OrderedHash.new
+
+ @keys.each_with_index do |key, index|
+ @ordered_hash[key] = @values[index]
+ end
end
def test_order