mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Merge pull request #35 from TheSeparateFirst/master
Fixed about_strings for multiple rubies
This commit is contained in:
@@ -139,13 +139,6 @@ EOS
|
|||||||
assert_equal __, string[7..9]
|
assert_equal __, string[7..9]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_you_can_get_a_single_character_from_a_string
|
|
||||||
string = "Bacon, lettuce and tomato"
|
|
||||||
assert_equal __, string[1]
|
|
||||||
|
|
||||||
# Surprised?
|
|
||||||
end
|
|
||||||
|
|
||||||
in_ruby_version("1.8") do
|
in_ruby_version("1.8") do
|
||||||
def test_in_ruby_1_8_single_characters_are_represented_by_integers
|
def test_in_ruby_1_8_single_characters_are_represented_by_integers
|
||||||
assert_equal __, ?a
|
assert_equal __, ?a
|
||||||
@@ -162,6 +155,26 @@ EOS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
in_ruby_version("1.8") do
|
||||||
|
def test_in_ruby_1_8_you_can_get_a_single_character_from_a_string
|
||||||
|
string = "Bacon, lettuce and tomato"
|
||||||
|
assert_equal __, string[1]
|
||||||
|
|
||||||
|
# Surprised?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
in_ruby_version("1.9") do
|
||||||
|
|
||||||
|
def test_in_ruby_1_9_you_can_get_a_single_character_from_a_string
|
||||||
|
string = "Bacon, lettuce and tomato"
|
||||||
|
assert_equal "__", string[1]
|
||||||
|
|
||||||
|
# Surprised?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def test_strings_can_be_split
|
def test_strings_can_be_split
|
||||||
string = "Sausage Egg Cheese"
|
string = "Sausage Egg Cheese"
|
||||||
words = string.split
|
words = string.split
|
||||||
|
|||||||
Reference in New Issue
Block a user