Permalink
Browse files

working

  • Loading branch information...
1 parent 099c978 commit f19f0438906ec80d9c6beca1c83e03ece3c8ed3a Danish Khan committed Mar 5, 2011
Showing with 12 additions and 12 deletions.
  1. +12 −12 koans/about_strings.rb
@@ -3,65 +3,65 @@
class AboutStrings < EdgeCase::Koan
def test_double_quoted_strings_are_strings
string = "Hello, World"
- assert_equal __, string.is_a?(String)
+ assert_equal true, string.is_a?(String)
end
def test_single_quoted_strings_are_also_strings
string = 'Goodbye, World'
- assert_equal __, string.is_a?(String)
+ assert_equal true, string.is_a?(String)
end
def test_use_single_quotes_to_create_string_with_double_quotes
string = 'He said, "Go Away."'
- assert_equal __, string
+ assert_equal "He said, \"Go Away.\"", string
end
def test_use_double_quotes_to_create_strings_with_single_quotes
string = "Don't"
- assert_equal __, string
+ assert_equal "Don't", string
end
def test_use_backslash_for_those_hard_cases
a = "He said, \"Don't\""
b = 'He said, "Don\'t"'
- assert_equal __, a == b
+ assert_equal true, a == b
end
def test_use_flexible_quoting_to_handle_really_hard_cases
a = %(flexible quotes can handle both ' and " characters)
b = %!flexible quotes can handle both ' and " characters!
c = %{flexible quotes can handle both ' and " characters}
- assert_equal __, a == b
- assert_equal __, a == c
+ assert_equal true, a == b
+ assert_equal true, a == c
end
def test_flexible_quotes_can_handle_multiple_lines
long_string = %{
It was the best of times,
It was the worst of times.
}
- assert_equal __, long_string.size
+ assert_equal 54, long_string.size
end
def test_here_documents_can_also_handle_multiple_lines
long_string = <<EOS
It was the best of times,
It was the worst of times.
EOS
- assert_equal __, long_string.size
+ assert_equal 53, long_string.size
end
def test_plus_will_concatenate_two_strings
string = "Hello, " + "World"
- assert_equal __, string
+ assert_equal "Hello, World", string
end
def test_plus_concatenation_will_leave_the_original_strings_unmodified
hi = "Hello, "
there = "World"
string = hi + there
- assert_equal __, hi
- assert_equal __, there
+ assert_equal "Hello, ", hi
+ assert_equal "World", there
end
def test_plus_equals_will_concatenate_to_the_end_of_a_string

0 comments on commit f19f043

Please sign in to comment.