From f6516526b5d27df352eca57c15860dbaa37a366c Mon Sep 17 00:00:00 2001 From: Akira Kuroda Date: Sat, 22 Feb 2014 00:19:29 +0900 Subject: add tests for String#capitalize! and String#downcase! --- test/t/string.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/t/string.rb b/test/t/string.rb index c42fa006f..56ae49d96 100644 --- a/test/t/string.rb +++ b/test/t/string.rb @@ -118,6 +118,7 @@ assert('String#capitalize', '15.2.10.5.7') do assert_equal 'abc', a assert_equal 'Abc', 'abc'.capitalize + assert_equal nil, 'Abc'.capitalize! end assert('String#capitalize!', '15.2.10.5.8') do @@ -196,6 +197,7 @@ assert('String#downcase', '15.2.10.5.13') do assert_equal 'abc', a assert_equal 'ABC', b + assert_equal nil, 'abc'.downcase! end assert('String#downcase!', '15.2.10.5.14') do -- cgit v1.2.3 From 61523d0e4f914af0c724511e13b9c497300c6071 Mon Sep 17 00:00:00 2001 From: Akira Kuroda Date: Sat, 22 Feb 2014 00:43:12 +0900 Subject: fix the position of capitalize! and downcast!, and add test for upcase! --- test/t/string.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/t/string.rb b/test/t/string.rb index 56ae49d96..3219f98c3 100644 --- a/test/t/string.rb +++ b/test/t/string.rb @@ -118,7 +118,6 @@ assert('String#capitalize', '15.2.10.5.7') do assert_equal 'abc', a assert_equal 'Abc', 'abc'.capitalize - assert_equal nil, 'Abc'.capitalize! end assert('String#capitalize!', '15.2.10.5.8') do @@ -126,6 +125,7 @@ assert('String#capitalize!', '15.2.10.5.8') do a.capitalize! assert_equal 'Abc', a + assert_equal nil, 'Abc'.capitalize! end assert('String#chomp', '15.2.10.5.9') do @@ -197,7 +197,6 @@ assert('String#downcase', '15.2.10.5.13') do assert_equal 'abc', a assert_equal 'ABC', b - assert_equal nil, 'abc'.downcase! end assert('String#downcase!', '15.2.10.5.14') do @@ -206,6 +205,7 @@ assert('String#downcase!', '15.2.10.5.14') do a.downcase! assert_equal 'abc', a + assert_equal nil, 'abc'.downcase! end assert('String#each_line', '15.2.10.5.15') do @@ -444,6 +444,7 @@ assert('String#upcase!', '15.2.10.5.43') do a.upcase! assert_equal 'ABC', a + assert_equal nil, 'ABC'.upcase! end # Not ISO specified -- cgit v1.2.3