summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/test/string.rb
diff options
context:
space:
mode:
authorAkira Moroo <[email protected]>2016-01-30 14:28:00 +0900
committerAkira Moroo <[email protected]>2016-01-30 14:28:00 +0900
commitcb1a80e74195f92ef6eca801d1e92a93788987db (patch)
tree5b657bdb0fb99570ecdeeddb5841cda34227a4f8 /mrbgems/mruby-string-ext/test/string.rb
parente86bc6bb478f5a73b960d4b08e102c7139eae2e1 (diff)
downloadmruby-cb1a80e74195f92ef6eca801d1e92a93788987db.tar.gz
mruby-cb1a80e74195f92ef6eca801d1e92a93788987db.zip
Add String#rjust test to 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 37a5d28cf..f68fbcb28 100644
--- a/mrbgems/mruby-string-ext/test/string.rb
+++ b/mrbgems/mruby-string-ext/test/string.rb
@@ -421,6 +421,13 @@ assert('String#ljust') do
assert_equal "hello", "hello".ljust(-3)
end
+assert('String#rjust') do
+ assert_equal "hello", "hello".rjust(4)
+ assert_equal " hello", "hello".rjust(20)
+ assert_equal "123412341234123hello", "hello".rjust(20, '1234')
+ assert_equal "hello", "hello".rjust(-3)
+end
+
assert('String#upto') do
a = "aa"
start = "aa"