webmock icon indicating copy to clipboard operation
webmock copied to clipboard

undefined method `reset_executed_requests!' for WebMock:Module in rspec test

Open wgordon17 opened this issue 6 years ago • 5 comments

Following the documentation, I've added require 'webmock/rspec' to my helper. But, when trying to use WebMock.reset_executed_requests!, I get the error message in the title.

Any help would be appreciated!

wgordon17 avatar Oct 24 '18 15:10 wgordon17

But thankfully this works fine WebMock::RequestRegistry.instance.reset!

Taken from: https://github.com/bblimke/webmock/blob/d8686502442d9830dcccd24a1120ac08413d857a/lib/webmock/api.rb#L70

wgordon17 avatar Oct 24 '18 15:10 wgordon17

@wgordon17 you're right. thank you for pointing that out!

bblimke avatar Oct 24 '18 20:10 bblimke

@bblimke Ok, so this is expected? Is it always expected, or just in the way I import for rspec?

wgordon17 avatar Oct 24 '18 20:10 wgordon17

That is not expected. It's a bug.

bblimke avatar Oct 24 '18 20:10 bblimke

Sorry, I will check it!

oliakremmyda avatar Oct 25 '18 07:10 oliakremmyda