git://git.eng.unimelb.edu.au
/
ruby_koans.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3fd8d9d
)
Fixed test_you_can_get_a_single_character_from_a_string for multiple rubies (1.8...
author
Jeffrey Murray
<a.separate.first@gmail.com>
Sat, 12 Mar 2011 01:34:59 +0000
(17:34 -0800)
committer
Jeffrey Murray
<a.separate.first@gmail.com>
Sat, 12 Mar 2011 01:34:59 +0000
(17:34 -0800)
koans/about_strings.rb
patch
|
blob
|
history
diff --git
a/koans/about_strings.rb
b/koans/about_strings.rb
index
27ccf72
..
48dfa2d
100644
(file)
--- a/
koans/about_strings.rb
+++ b/
koans/about_strings.rb
@@
-139,13
+139,6
@@
EOS
assert_equal __, string[7..9]
end
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
in_ruby_version("1.8") do
def test_in_ruby_1_8_single_characters_are_represented_by_integers
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 "a", string[1]
+
+ # Surprised?
+ end
+ end
+
+
def test_strings_can_be_split
string = "Sausage Egg Cheese"
words = string.split
def test_strings_can_be_split
string = "Sausage Egg Cheese"
words = string.split