Bacon integration is counting ExpectationErrors as errors not failures
Reported by James Mead | March 5th, 2009 @ 03:49 PM
Much like the problem [1] with MiniTest.
[1] http://floehopper.lighthouseapp....
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), "lib"))
require 'bacon'
require 'mocha'
Bacon.extend(Bacon::TestUnitOutput)
Bacon.summary_on_exit
describe 'TempTest' do
should 'test_me' do
mockee = mock()
mockee.expects(:blah)
end
end
E
Mocha::ExpectationError: not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:0x18cba8>.blah(any_parameters)
at top level in temp_test.rb at line 12
at top level in temp_test.rb at line 10
at top level in temp_test.rb at line 8
1 tests, 1 assertions, 0 failures, 1 errors
Should be :-
1 tests, 1 assertions, 1 failures, 0 errors
Suggested solution :-
- Correct and add assertions to BaconTest as per MiniTestTest. This should give at least 4 failing tests.
- Make users explicitly require relevant version of Mocha e.g. require 'mocha/integration/bacon'
- Introduce the concept of an ExpectationErrorTranslator or similar. This will raise the appropriate exception depending on which test framework is being integrated. It may have to be set on the Mockery or similar.
- We should be able to apply this to Test::Unit and MiniTest to simplify the monkey-patching of e.g. TestCase#run
- See Mocha::Integration::MiniTest.translate for the beginnings of this idea.
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A mocking & stubbing library for Ruby.
* <a href="http://github.com/floehopper/mocha">GitHub repository</a>
* <a href="http://mocha.rubyforge.org">Documentation</a>
* <a href="http://groups.google.com/group/mocha-developer">Mailing List</a>