jimweirich / flexmock

Flexible mocking for Ruby testing
http://flexmock.rubyforge.org/
94 stars 26 forks source link

FlexMock no longer works with Minitest #15

Open zhon opened 11 years ago

zhon commented 11 years ago

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 commented 11 years ago

Thanks. Looking into this.

jimweirich commented 11 years ago

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 commented 11 years ago

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

ngiger commented 11 years ago

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 commented 10 years ago

Related to #16

doudou commented 9 years ago

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.