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

v0.5.0 breaks isolation tests with minitest mocks #49

Closed
TiteiKo opened this issue Nov 26, 2018 · 1 comment
Closed

v0.5.0 breaks isolation tests with minitest mocks #49

TiteiKo opened this issue Nov 26, 2018 · 1 comment

Comments

@TiteiKo
Copy link

TiteiKo commented Nov 26, 2018

class Foobar
  include Inject[foo: 'bar']

  def do_something
    foo.do_something
    # ....
  end
end

# would be tested like this

class FoobarTest < Minitest::Test
  def test_it_calls_do_something_of_foo
    mock = Minitest::Mock.new
    mock.expect :do_something
    Foobar.new(foo: mock).do_something
    assert_mocked mock
  end
end

This was working fine before 0.5.0. Now, it gets the error unmocked method :nil?, expected one of [:do_something] due to 193ed48#diff-f6dd1c9acc3de0d2ccbed1741aa38257, thus rendering mocking non straightforward

@timriley
Copy link
Member

Thanks for raising this, @TiteiKo. I've adjusted some code in a currently-open PR (#48) to fix this issue.

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

2 participants