Commit b9cf5045 authored by Daniel Bovensiepen's avatar Daniel Bovensiepen

Add Test for String#each_byte

parent 8d9f5628
...@@ -346,3 +346,13 @@ assert('String#bytes') do ...@@ -346,3 +346,13 @@ assert('String#bytes') do
str1.bytes == bytes1 str1.bytes == bytes1
end end
assert('String#each_byte') do
str1 = "hello"
bytes1 = [104, 101, 108, 108, 111]
bytes2 = []
str1.each_byte {|b| bytes2 << b }
bytes1 == bytes2
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment