Missing tests #519

Merged
merged 6 commits into from May 29, 2012

Conversation

Projects
None yet
3 participants
Contributor

mattwildig commented May 29, 2012

Running RUBYOPT=-w rake test revealed several tests that were hidden by redefining the same method, so they ended up being lost. This uncovers 6 tests and 11 assertions.

mattwildig added some commits May 29, 2012

Resolve test name conflict
In delegator_test.rb, there are two tests named
"registers helpers with the delegation target", causing "method
redefined" warnings and the first test not to be run.

Rename the second test so that all tests run.
Resolve test name conflict
In AfterFilterTest in filter_test.rb there are two tests named
"executes filters in the order defined", causing the first not to be
run.

Rename the first test, and fix the mock app in the test so it doesn't
cause a Rack::Lint error.
Resolve test name conflict
There are two tests named
"is possible to apply user_agent conditions to before filters with a path"
in filters_test.rb, causing "method redefined" warnings and tests not
being run.

Rename second of these to accurately describe what it's testing
Resolve test name conflict
sanitize_name in contest.rb strips out any non-word characters, so
'is false for status > 404' and 'is false for status < 404' end up as
having the same test name, causing lost tests.

Rename these tests to use 'gt' and 'lt' rather then '>' and '<'.
Resolve test name conflict
There are two tests named
'sets the Content-Type response header without extname' in
helpers_test.rb.

Rename the second to accurately describe what it tests.
Resolve test name conflict
There are two tests named 'allows passing time objects'.

Rename tests so they don't clash.

This pull request passes (merged 1c262be into f948c23).

rkh added a commit that referenced this pull request May 29, 2012

@rkh rkh merged commit 40e967b into sinatra:master May 29, 2012

Owner

rkh commented May 29, 2012

Maybe we should fix this in contest somehow.

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