Comments (3)
Under Ruby 2.0.0 it works:
Run options: --seed 53091
Running:
E
Finished in 0.108801s, 9.1911 runs/s, 9.1911 assertions/s.
- Error:
TestMyClass#test_my_class:
Test::Unit::AssertionFailedError: in mock 'classToBeMocked': Method 'will_never_be_called(*args)' called incorrect number of times
1 matching call expected
0 matching calls found
The following messages have been received:
returns_false() matched by should_receive(:returns_false).once
.
is not true.
test/pry_test.rb:28:intest_my_class' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:51:in
block in assert_block'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:1437:incall' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:1437:in
_wrap_assertion'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:49:inassert_block' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:82:in
block in assert'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:1442:incall' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:1442:in
_wrap_assertion'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/test-unit-2.5.5/lib/test/unit/assertions.rb:64:inassert' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/test_unit_integration.rb:53:in
make_assertion'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/validators.rb:60:inblock in validate_count' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/expectation.rb:414:in
flexmock_location_filter'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/validators.rb:59:invalidate_count' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/validators.rb:78:in
validate'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/expectation.rb:141:inblock in flexmock_verify' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/expectation.rb:140:in
each'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/expectation.rb:140:inflexmock_verify' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/expectation_director.rb:65:in
block in flexmock_verify'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/expectation_director.rb:64:ineach' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/expectation_director.rb:64:in
flexmock_verify'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/core.rb:86:inblock (2 levels) in flexmock_verify' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/core.rb:85:in
each'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/core.rb:85:inblock in flexmock_verify' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/core.rb:266:in
flexmock_wrap'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/core.rb:84:inflexmock_verify' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/mock_container.rb:40:in
block in flexmock_verify'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/mock_container.rb:39:ineach' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/mock_container.rb:39:in
flexmock_verify'
/home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/mock_container.rb:32:inflexmock_teardown' /home/niklaus/.rvm/gems/ruby-2.0.0-p247/gems/flexmock-1.3.2/lib/flexmock/test_unit_integration.rb:39:in
teardown'
1 runs, 1 assertions, 0 failures, 1 errors, 0 skips
from flexmock.
More information about that one: minitest 5 requires everything that includes MiniTest::Assertions to provide an "assertions" accessor. See minitest/minitest#286
from flexmock.
A word: I'm trying to take over the maintenance of flexmock. It's unfortunately bit-rotting since Jim's passing, and that's really a pity - both for his memory as a great contributor to Ruby's community and as a really nice piece of software.
I've fixed that particular issue, as well as added minitest-specific support and some other things
there: https://github.com/doudou/flexmock. I'm going to try and get the rights to push new gems versions, but I really don't know if it's going to happen.
from flexmock.
Related Issues (16)
- Wrong "called incorrect number of times" error when multiple expectations are registered on the same method HOT 4
- assert_block deprecated in minitest-2.12.0 and later HOT 3
- Spying on objects without pre-defining any expectations HOT 1
- flexmock raises "undefined method 'teardown'" on minitest HOT 2
- FlexMock no longer works with Minitest HOT 6
- The "have_received" matcher needs a description method. HOT 1
- flexmock(Dog).new_instances(:allocate) disabled in 1.9
- NoMethodError: undefined method `assertions'
- Ordered should_receive expectations with recurring arguments fail
- License file?
- Unneeded shebang for tags.rake
- Link to https://github.com/doudou/flexmock
- Flexmock 0.8.11 seems to require Ruby 1.9.x or greater, readme says 1.8.x or greater HOT 1
- Object#methods(false) broken on new Rubies HOT 1
- flexmock throws NameError when mocking a method created by method_missing and respond_to_missing? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexmock.