Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlexMock no longer works with Minitest #15

Open
zhon opened this issue Aug 18, 2013 · 6 comments
Open

FlexMock no longer works with Minitest #15

zhon opened this issue Aug 18, 2013 · 6 comments

Comments

@zhon
Copy link

zhon commented Aug 18, 2013

Running flexmock 1.3.2 & Minitest 5.0.6

require 'minitest/autorun'
require 'flexmock/unit_test'

class TestFlexMock < Minitest::Test

  def test_this
    flexmock()
  end

end

results in

TestFlexMock#test_this:
NoMethodError: undefined method `flexmock' for #<TestFlexMock:0x00000101253c60>
    blah.rb:8:in `test_this'
@jimweirich
Copy link
Owner

Thanks. Looking into this.

@jimweirich
Copy link
Owner

This seems to be a Minitest 4 VS 5 thing. MT4 still ships with Ruby 2, so I have to support that, but MT5 is often installed as a gem. I'm going to have to figure out how to test against both in an automated way.

Sigh :{

@zhon
Copy link
Author

zhon commented Aug 20, 2013

Yeah, chasing MiniTest API changes is difficult. Sadly, they have an under developed mocking framework.

@ngiger
Copy link

ngiger commented Sep 25, 2013

Under Ruby 1.9.3 I work with a pattern like this:

gem "minitest"
require 'minitest/autorun'
require 'flexmock'
class TestFlexMock < Minitest::Test
include FlexMock::TestCase
def test_this
flexmock()
end
end

@doudou
Copy link

doudou commented Jun 15, 2014

Related to #16

@doudou
Copy link

doudou commented Jun 29, 2015

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.

doudou added a commit to doudou/flexmock that referenced this issue Jun 29, 2015
It is compatible with pre-5 minitest (as shipped with ruby until
at least 2.1) and 5.0+

Note that flexmock's own testsuite currently requires plain ruby,
so you can't run the main testsuite if the 5.0+ minitest gem is active

Fixes jimweirich#15 and
jimweirich#16.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants