Permalink
Browse files

fix deprecation messages

  • Loading branch information...
1 parent be0df72 commit 088ed6aff1ce36c62e77f7acd1f61f899707aff9 @montague montague committed Aug 15, 2013
Showing with 19 additions and 19 deletions.
  1. +1 −1 Gemfile
  2. +11 −11 spec/unit/errors_spec.rb
  3. +1 −1 spec/unit/request_execution_verifier_spec.rb
  4. +3 −3 spec/unit/response_spec.rb
  5. +2 −2 test/shared_test.rb
  6. +1 −1 test/test_helper.rb
View
@@ -14,7 +14,7 @@ end
group :test do
gem 'rack'
- gem 'minitest_tu_shim'
+ gem 'minitest_tu_shim', :git => "https://github.com/seattlerb/minitest_tu_shim.git"
end
platforms :jruby do
View
@@ -4,24 +4,24 @@
describe WebMock::NetConnectNotAllowedError do
describe "message" do
it "should have message with request signature and snippet" do
- request_signature = mock(:to_s => "aaa")
- request_stub = mock
- WebMock::RequestStub.stub!(:from_request_signature).and_return(request_stub)
- WebMock::StubRequestSnippet.stub!(:new).
- with(request_stub).and_return(mock(:to_s => "bbb"))
+ request_signature = double(:to_s => "aaa")
+ request_stub = double
+ WebMock::RequestStub.stub(:from_request_signature).and_return(request_stub)
+ WebMock::StubRequestSnippet.stub(:new).
+ with(request_stub).and_return(double(:to_s => "bbb"))
expected = "Real HTTP connections are disabled. Unregistered request: aaa" +
"\n\nYou can stub this request with the following snippet:\n\n" +
"bbb\n\n============================================================"
WebMock::NetConnectNotAllowedError.new(request_signature).message.should == expected
end
it "should have message with registered stubs if available" do
- request_signature = mock(:to_s => "aaa")
- request_stub = mock
- WebMock::StubRegistry.instance.stub!(:request_stubs).and_return([request_stub])
- WebMock::RequestStub.stub!(:from_request_signature).and_return(request_stub)
- WebMock::StubRequestSnippet.stub!(:new).
- with(request_stub).and_return(mock(:to_s => "bbb"))
+ request_signature = double(:to_s => "aaa")
+ request_stub = double
+ WebMock::StubRegistry.instance.stub(:request_stubs).and_return([request_stub])
+ WebMock::RequestStub.stub(:from_request_signature).and_return(request_stub)
+ WebMock::StubRequestSnippet.stub(:new).
+ with(request_stub).and_return(double(:to_s => "bbb"))
expected = "Real HTTP connections are disabled. Unregistered request: aaa" +
"\n\nYou can stub this request with the following snippet:\n\n" +
"bbb\n\nregistered request stubs:\n\nbbb\n\n============================================================"
@@ -3,7 +3,7 @@
describe WebMock::RequestExecutionVerifier do
before(:each) do
@verifier = WebMock::RequestExecutionVerifier.new
- @request_pattern = mock(WebMock::RequestPattern, :to_s => "www.example.com")
+ @request_pattern = double(WebMock::RequestPattern, :to_s => "www.example.com")
@verifier.request_pattern = @request_pattern
WebMock::RequestRegistry.instance.stub(:to_s).and_return("executed requests")
@executed_requests_info = "\n\nThe following requests were made:\n\nexecuted requests\n" + "="*60
@@ -6,14 +6,14 @@
it "should create response with options passed as arguments" do
options = {:body => "abc", :headers => {:a => :b}}
- WebMock::Response.should_receive(:new).with(options).and_return(@response = mock(WebMock::Response))
+ WebMock::Response.should_receive(:new).with(options).and_return(@response = double(WebMock::Response))
WebMock::ResponseFactory.response_for(options).should == @response
end
it "should create dynamic response for argument responding to call" do
- callable = mock(:call => {:body => "abc"})
- WebMock::DynamicResponse.should_receive(:new).with(callable).and_return(@response = mock(WebMock::Response))
+ callable = double(:call => {:body => "abc"})
+ WebMock::DynamicResponse.should_receive(:new).with(callable).and_return(@response = double(WebMock::Response))
WebMock::ResponseFactory.response_for(callable).should == @response
end
View
@@ -10,13 +10,13 @@ def setup
end
def test_assert_requested_with_stub_and_block_raises_error
- assert_raise ArgumentError do
+ assert_raises ArgumentError do
assert_requested(@stub_http) {}
end
end
def test_assert_not_requested_with_stub_and_block_raises_error
- assert_raise ArgumentError do
+ assert_raises ArgumentError do
assert_not_requested(@stub_http) {}
end
end
View
@@ -9,7 +9,7 @@
class Test::Unit::TestCase
AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion
def assert_raise_with_message(e, message, &block)
- e = assert_raise(e, &block)
+ e = assert_raises(e, &block)
if message.is_a?(Regexp)
assert_match(message, e.message)
else

0 comments on commit 088ed6a

Please sign in to comment.