Skip to content

Commit

Permalink
Add test that fails when given text without any URLs in it
Browse files Browse the repository at this point in the history
  • Loading branch information
jage committed Feb 20, 2014
1 parent 6d210a9 commit dfe29e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit/normalization_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class NormalizerTest < Test::Unit::TestCase
url = "http://www.aoo.se/öö"
assert_equal [url], @normalizer.normalize(url)
end

should "should not blow up when there's no URL in the text" do
url = "Just some text"
assert @normalizer.normalize(url)
end
end

context ".extract_urls" do
Expand Down

4 comments on commit dfe29e1

@dentarg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message:

Add test that fails when given text without any URLs in it

Test:

"should not blow up when there's no URL in the text"

Uhm, contradiction?

@jage
Copy link
Contributor Author

@jage jage commented on dfe29e1 Feb 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test was red, there was no support for it. "Failing test"

@dentarg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, okay, but I read "test that fails" and expected something like assert_raise in the code.

It's hard to know that the test fails when reading the diff...

@jage
Copy link
Contributor Author

@jage jage commented on dfe29e1 Feb 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Please sign in to comment.