aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/array_ext_test.rb10
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb4
2 files changed, 13 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb
index 2ee86c8af9..159dc2a478 100644
--- a/activesupport/test/core_ext/array_ext_test.rb
+++ b/activesupport/test/core_ext/array_ext_test.rb
@@ -19,7 +19,15 @@ class ArrayExtConversionTests < Test::Unit::TestCase
end
def test_to_sentence_with_connector
- assert_equal "one, two, and also three", ['one', 'two', 'three'].to_sentence('and also')
+ assert_equal "one, two, and also three", ['one', 'two', 'three'].to_sentence(:connector => 'and also')
+ end
+
+ def test_to_sentence_with_skip_last_comma
+ assert_equal "one, two and three", ['one', 'two', 'three'].to_sentence(:skip_last_comma => true)
+ end
+
+ def test_two_elements
+ assert_equal "one and two", ['one', 'two'].to_sentence
end
def test_one_element
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index f42b6fde2f..4ae2dd8e7c 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -118,4 +118,8 @@ class HashExtTest < Test::Unit::TestCase
indiff = original.with_indifferent_access
assert(!indiff.keys.any? {|k| k.kind_of? String}, "A key was converted to a string!")
end
+
+ def test_reverse_merge
+ assert_equal({ :a => 1, :b => 2, :c => 10 }, { :a => 1, :b => 2 }.reverse_merge({:a => "x", :b => "y", :c => 10}) )
+ end
end