Permalink
Browse files

Stubs and registered requests are reset after each test/example rathe…

…r than before each test.
  • Loading branch information...
bblimke committed Nov 5, 2010
1 parent 7a8bab1 commit 622912b3b62bb860e075193805d88645afc1cb16
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/webmock/rspec.rb
  2. +4 −4 lib/webmock/test_unit.rb
View
@@ -24,7 +24,7 @@
config.include WebMock::API
config.include WebMock::Matchers
- config.before :each do
+ config.after(:each) do
WebMock.reset!
end
}
View
@@ -6,12 +6,12 @@ module Unit
class TestCase
include WebMock::API
- alias_method :setup_without_webmock, :setup
- def setup_with_webmock
- setup_without_webmock
+ alias_method :teardown_without_webmock, :teardown
+ def teardown_with_webmock
+ teardown_without_webmock
WebMock.reset!
end
- alias_method :setup, :setup_with_webmock
+ alias_method :teardown, :teardown_with_webmock
end
end

0 comments on commit 622912b

Please sign in to comment.