Skip to content
Browse files

Clarify string length versus line count

  • Loading branch information...
1 parent ac3b3d6 commit 3e6d01a15b4ac9199b8cdb0b58e703cb80577c88 @tjkirch tjkirch committed Mar 6, 2011
Showing with 8 additions and 4 deletions.
  1. +4 −2 koans/about_strings.rb
  2. +4 −2 src/about_strings.rb
View
6 koans/about_strings.rb
@@ -40,15 +40,17 @@ def test_flexible_quotes_can_handle_multiple_lines
It was the best of times,
It was the worst of times.
}
- assert_equal __, long_string.size
+ assert_equal __, long_string.length
+ assert_equal __, long_string.lines.count
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 __, long_string.length
+ assert_equal __, long_string.lines.count
end
def test_plus_will_concatenate_two_strings
View
6 src/about_strings.rb
@@ -40,15 +40,17 @@ def test_flexible_quotes_can_handle_multiple_lines
It was the best of times,
It was the worst of times.
}
- assert_equal __(54), long_string.size
+ assert_equal __(54), long_string.length
+ assert_equal __(3), long_string.lines.count
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 __(53), long_string.size
+ assert_equal __(53), long_string.length
+ assert_equal __(2), long_string.lines.count
end
def test_plus_will_concatenate_two_strings

0 comments on commit 3e6d01a

Please sign in to comment.
Something went wrong with that request. Please try again.