Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix deprecation messages

  • Loading branch information...
commit 088ed6aff1ce36c62e77f7acd1f61f899707aff9 1 parent be0df72
@montague montague authored
View
2  Gemfile
@@ -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
22 spec/unit/errors_spec.rb
@@ -4,11 +4,11 @@
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============================================================"
@@ -16,12 +16,12 @@
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============================================================"
View
2  spec/unit/request_execution_verifier_spec.rb
@@ -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
View
6 spec/unit/response_spec.rb
@@ -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
4 test/shared_test.rb
@@ -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
2  test/test_helper.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.