Skip to content

Commit

Permalink
Clarify string length versus line count
Browse files Browse the repository at this point in the history
  • Loading branch information
tjkirch committed Jun 3, 2011
1 parent ac3b3d6 commit 3e6d01a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions koans/about_strings.rb
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/about_strings.rb
Expand Up @@ -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
Expand Down

0 comments on commit 3e6d01a

Please sign in to comment.