Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't modify the input string in place

  • Loading branch information...
commit 42c22253884c5ce9bfd4dbda2c319b66296732b5 1 parent 94d27e1
@msaffitz msaffitz authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  lib/email_reply_parser.rb
  2. +6 −0 test/email_reply_parser_test.rb
2  lib/email_reply_parser.rb
@@ -62,7 +62,7 @@ def initialize
def read(text)
# The text is reversed initially due to the way we check for hidden
# fragments.
- text.reverse!
+ text = text.reverse
# This determines if any 'visible' Fragment has been found. Once any
# visible Fragment is found, stop looking for hidden ones.
6 test/email_reply_parser_test.rb
@@ -71,6 +71,12 @@ def test_recognizes_date_string_above_quote
assert_match /Loader/, reply.fragments[1].to_s
+ def test_does_not_modify_input_string
+ original = "The Quick Brown Fox Jumps Over The Lazy Dog"
+ original
+ assert_equal "The Quick Brown Fox Jumps Over The Lazy Dog", original
+ end
def email(name)
body = EMAIL_FIXTURE_PATH.join("#{name}.txt").to_s body

1 comment on commit 42c2225


9-11-76 come and get it now the game is on and I'm ahead of you

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