coffee test: strip body in equal assertions #404

Merged
merged 1 commit into from Nov 9, 2011

Conversation

Projects
None yet
3 participants
Contributor

lest commented Nov 9, 2011

I got errors running tests

  1) Failure:
test_passes_coffee_options_to_the_coffee_engine(CoffeeTest) [/Users/lest/code/sinatra/test/coffee_test.rb:74]:
<"alert('Aye!');"> expected but was
<"\nalert('Aye!');\n">.

  2) Failure:
test_passes_default_coffee_options_to_the_coffee_engine(CoffeeTest)     [/Users/lest/code/sinatra/test/coffee_test.rb:86]:
<"alert('Aye!');"> expected but was
<"\nalert('Aye!');\n">.

So I think it's good to use stripped body in assertion

Contributor

josh commented Nov 9, 2011

CoffeeScript 1.1.3 has whitespace changes. Probably should use a regexp to test what you care about here.

Owner

rkh commented Nov 9, 2011

We have an assert_body helper for whitespace/newline insensitive matching.

Contributor

lest commented Nov 9, 2011

Thanks, I've used assert_body.

rkh added a commit that referenced this pull request Nov 9, 2011

Merge pull request #404 from lest/coffee-test-fix
coffee test: strip body in equal assertions

@rkh rkh merged commit 84aac76 into sinatra:master Nov 9, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment