aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/string_ext_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-17 13:44:59 -0500
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-17 13:44:59 -0500
commit60896ca6f4c89260cb9770487f80dec829674b89 (patch)
tree7630f84d10ab607dda8c4a57026cf3d75d4d7f82 /activesupport/test/core_ext/string_ext_test.rb
parentabb899c54e8777428b7a607774370ba29a5573bd (diff)
downloadrails-60896ca6f4c89260cb9770487f80dec829674b89.tar.gz
rails-60896ca6f4c89260cb9770487f80dec829674b89.tar.bz2
rails-60896ca6f4c89260cb9770487f80dec829674b89.zip
Clearer String#first and #last edge cases. Fix that foo.first(0) == instead of foo.
Diffstat (limited to 'activesupport/test/core_ext/string_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
index 6c9b7e7236..7d51e81feb 100644
--- a/activesupport/test/core_ext/string_ext_test.rb
+++ b/activesupport/test/core_ext/string_ext_test.rb
@@ -132,10 +132,12 @@ class StringInflectionsTest < Test::Unit::TestCase
assert_equal "h", s.first
assert_equal "he", s.first(2)
+ assert_equal "", s.first(0)
assert_equal "o", s.last
assert_equal "llo", s.last(3)
assert_equal "hello", s.last(10)
+ assert_equal "", s.last(0)
assert_equal 'x', 'x'.first
assert_equal 'x', 'x'.first(4)