flexmock icon indicating copy to clipboard operation
flexmock copied to clipboard

FlexMock no longer works with Minitest

Open zhon opened this issue 12 years ago • 6 comments

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'

zhon avatar Aug 18 '13 00:08 zhon

Thanks. Looking into this.

jimweirich avatar Aug 19 '13 17:08 jimweirich

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 :{

jimweirich avatar Aug 20 '13 19:08 jimweirich

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

zhon avatar Aug 20 '13 22:08 zhon

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

ngiger avatar Sep 25 '13 12:09 ngiger

Related to #16

doudou avatar Jun 15 '14 12:06 doudou

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 avatar Jun 29 '15 13:06 doudou