Skip to content

HTTPS clone URL

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
View
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.
View
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
end
+ def test_does_not_modify_input_string
+ original = "The Quick Brown Fox Jumps Over The Lazy Dog"
+ EmailReplyParser.read original
+ assert_equal "The Quick Brown Fox Jumps Over The Lazy Dog", original
+ end
+
def email(name)
body = IO.read EMAIL_FIXTURE_PATH.join("#{name}.txt").to_s
EmailReplyParser.read body

1 comment on commit 42c2225

@hbg49

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.