Back ported a lot of changes made to the Koans directory.

Evidently, a lot of changes / pull requests were made to the koans
directory and not to the src directory.  Perhaps we should remove the
koans directory entirely from the repo.
This commit is contained in:
Jim Weirich
2011-12-04 02:00:22 -05:00
parent 51acb84736
commit 6592f3d36e
16 changed files with 145 additions and 81 deletions

View File

@@ -141,6 +141,13 @@ EOS
assert_equal __, string[7..9]
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
def test_in_ruby_1_8_single_characters_are_represented_by_integers
assert_equal __, ?a
@@ -157,26 +164,6 @@ EOS
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
string = "Sausage Egg Cheese"
words = string.split