Skip to content

Commit 7cb32a5

Browse files
authored
Merge pull request #83 from github/antonio/fix-security-issues
Update tests to address code scanning issues
2 parents 13dfbab + 91ae61d commit 7cb32a5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/email_reply_parser_test.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class EmailReplyParserTest < Test::Unit::TestCase
1313
def test_encoding_should_be_maintained
14-
body = IO.read EMAIL_FIXTURE_PATH.join("email_1_1.txt").to_s
14+
body = File.read EMAIL_FIXTURE_PATH.join("email_1_1.txt").to_s
1515
EmailReplyParser.read body
1616
reply = email(:email_1_1)
1717
fragments = reply.fragments
@@ -152,48 +152,48 @@ def test_returns_only_the_visible_fragments_as_a_string
152152
end
153153

154154
def test_parse_out_just_top_for_outlook_reply
155-
body = IO.read EMAIL_FIXTURE_PATH.join("email_2_1.txt").to_s
155+
body = File.read EMAIL_FIXTURE_PATH.join("email_2_1.txt").to_s
156156
assert_equal "Outlook with a reply", EmailReplyParser.parse_reply(body)
157157
end
158158

159159
def test_parse_out_just_top_for_outlook_with_reply_directly_above_line
160-
body = IO.read EMAIL_FIXTURE_PATH.join("email_2_2.txt").to_s
160+
body = File.read EMAIL_FIXTURE_PATH.join("email_2_2.txt").to_s
161161
assert_equal "Outlook with a reply directly above line", EmailReplyParser.parse_reply(body)
162162
end
163163

164164
def test_parse_out_just_top_for_outlook_with_no_line
165-
body = IO.read EMAIL_FIXTURE_PATH.join("email_2_3.txt").to_s
165+
body = File.read EMAIL_FIXTURE_PATH.join("email_2_3.txt").to_s
166166
assert_equal "Outlook with a reply directly above line", EmailReplyParser.parse_reply(body)
167167
end
168168

169169
def test_parse_out_sent_from_iPhone
170-
body = IO.read EMAIL_FIXTURE_PATH.join("email_iPhone.txt").to_s
170+
body = File.read EMAIL_FIXTURE_PATH.join("email_iPhone.txt").to_s
171171
assert_equal "Here is another email", EmailReplyParser.parse_reply(body)
172172
end
173173

174174
def test_parse_out_sent_from_BlackBerry
175-
body = IO.read EMAIL_FIXTURE_PATH.join("email_BlackBerry.txt").to_s
175+
body = File.read EMAIL_FIXTURE_PATH.join("email_BlackBerry.txt").to_s
176176
assert_equal "Here is another email", EmailReplyParser.parse_reply(body)
177177
end
178178

179179
def test_parse_out_send_from_multiword_mobile_device
180-
body = IO.read EMAIL_FIXTURE_PATH.join("email_multi_word_sent_from_my_mobile_device.txt").to_s
180+
body = File.read EMAIL_FIXTURE_PATH.join("email_multi_word_sent_from_my_mobile_device.txt").to_s
181181
assert_equal "Here is another email", EmailReplyParser.parse_reply(body)
182182
end
183183

184184
def test_do_not_parse_out_send_from_in_regular_sentence
185-
body = IO.read EMAIL_FIXTURE_PATH.join("email_sent_from_my_not_signature.txt").to_s
185+
body = File.read EMAIL_FIXTURE_PATH.join("email_sent_from_my_not_signature.txt").to_s
186186
assert_equal "Here is another email\n\nSent from my desk, is much easier then my mobile phone.", EmailReplyParser.parse_reply(body)
187187
end
188188

189189
def test_retains_bullets
190-
body = IO.read EMAIL_FIXTURE_PATH.join("email_bullets.txt").to_s
190+
body = File.read EMAIL_FIXTURE_PATH.join("email_bullets.txt").to_s
191191
assert_equal "test 2 this should list second\n\nand have spaces\n\nand retain this formatting\n\n\n - how about bullets\n - and another",
192192
EmailReplyParser.parse_reply(body)
193193
end
194194

195195
def test_parse_reply
196-
body = IO.read EMAIL_FIXTURE_PATH.join("email_1_2.txt").to_s
196+
body = File.read EMAIL_FIXTURE_PATH.join("email_1_2.txt").to_s
197197
assert_equal EmailReplyParser.read(body).visible_text, EmailReplyParser.parse_reply(body)
198198
end
199199

@@ -230,7 +230,7 @@ def test_long_quote_processing_completes
230230
end
231231

232232
def email(name)
233-
body = IO.read EMAIL_FIXTURE_PATH.join("#{name}.txt").to_s
233+
body = File.read EMAIL_FIXTURE_PATH.join("#{name}.txt").to_s
234234
EmailReplyParser.read body
235235
end
236236
end

0 commit comments

Comments
 (0)