summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/test/string.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-01-13 16:19:46 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-01-13 16:19:46 +0900
commit4aef1ad209179e67bbeb9d3bfaad2f5d233d958e (patch)
tree366cf6146d52f93e4c72a96e0b632949222fd463 /mrbgems/mruby-string-ext/test/string.rb
parent1ab79ac41494320624cbfd40163ebcf4634caf31 (diff)
parent1b606025ed1a9813267bf8ac4440fc9dd5fc120c (diff)
downloadmruby-4aef1ad209179e67bbeb9d3bfaad2f5d233d958e.tar.gz
mruby-4aef1ad209179e67bbeb9d3bfaad2f5d233d958e.zip
Merge pull request #2700 from takahashim/string-ljust
add String#ljust into mruby-string-ext
Diffstat (limited to 'mrbgems/mruby-string-ext/test/string.rb')
-rw-r--r--mrbgems/mruby-string-ext/test/string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb
index 9fa835249..83e69859b 100644
--- a/mrbgems/mruby-string-ext/test/string.rb
+++ b/mrbgems/mruby-string-ext/test/string.rb
@@ -386,3 +386,10 @@ assert('String#prepend') do
assert_equal "hello world", a.prepend("hello ")
assert_equal "hello world", a
end
+
+assert('String#ljust') do
+ assert_equal "hello", "hello".ljust(4)
+ assert_equal "hello ", "hello".ljust(20)
+ assert_equal "hello123412341234123", "hello".ljust(20, '1234')
+ assert_equal "hello", "hello".ljust(-3)
+end