Closed bensie closed 1 year ago
LOL, embarrassing. Thanks for the report
Released a fix in 0.9.4
Good to go, thank you! Is there a proper place to insert a suite-wide teardown Mocktail.reset
with TLDR?
Just like minitest, in your helper, you can just open up or extend TLDR
:
class TLDR
def teardown
Mocktail.reset
end
end
Just remember to call super
if any of your tests that extend this also define teardown
Ok cool that works, thanks. With these here though, it throws a warning.
/Users/james/Code/hotsock-ruby/test/helper.rb:23: warning: method redefined; discarding old teardown
/Users/james/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/tldr-0.9.4/lib/tldr.rb:28: warning: previous definition of teardown was here
Whoops, that's no good. I recall adding default implementations for setup/teardown for some reason but it definitely shouldn't impact users this way.
Playing with
tldr
and trying to move some Minitest mocks over. The following exception is raised just by having the Mocktail gem loaded (without even using it). Removegem "mocktail"
and the test below works as expected.Gemfile
test/my_class_test.rb