Skip to content

Commit

Permalink
changes for the new around hook behaviour
Browse files Browse the repository at this point in the history
introduced by rubiii/savon#291
  • Loading branch information
rubiii committed Jun 8, 2012
1 parent 19b4d9b commit d22b7f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/savon/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ module Spec
end

RSpec.configure do |config|
config.after { Savon.config.hooks.reject!(Savon::Spec::Mock::HOOKS) }
config.after { Savon.config.hooks.reject(Savon::Spec::Mock::HOOKS) }
end
10 changes: 5 additions & 5 deletions lib/savon/spec/mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Mock
def expects(expected)
self.action = expected

Savon.config.hooks.define(:spec_action, :soap_request) do |request|
Savon.config.hooks.define(:spec_action, :soap_request) do |_, request|
actual = request.soap.input[1]
raise ExpectationError, "expected #{action.inspect} to be called, got: #{actual.inspect}" unless actual == action

Expand All @@ -28,7 +28,7 @@ def expects(expected)
# Accepts a SOAP +body+ to check if it was set. Also accepts a +block+
# which receives the <tt>Savon::SOAP::Request</tt> to set up custom expectations.
def with(body = nil, &block)
Savon.config.hooks.define(:spec_body, :soap_request) do |request|
Savon.config.hooks.define(:spec_body, :soap_request) do |_, request|
if block
block.call(request)
else
Expand All @@ -49,7 +49,7 @@ def returns(response = nil)
when Hash then response
end

Savon.config.hooks.define(:spec_response, :soap_request) do |request|
Savon.config.hooks.define(:spec_response, :soap_request) do |_, request|
respond_with(http)
end

Expand All @@ -58,9 +58,9 @@ def returns(response = nil)

# Expects that the +action+ doesn't get called.
def never
Savon.config.hooks.reject!(:spec_action)
Savon.config.hooks.reject(:spec_action)

Savon.config.hooks.define(:spec_never, :soap_request) do |request|
Savon.config.hooks.define(:spec_never, :soap_request) do |_, request|
actual = request.soap.input[1]
raise ExpectationError, "expected #{action.inspect} never to be called, but it was!" if actual == action

Expand Down
2 changes: 1 addition & 1 deletion savon_spec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|

s.rubyforge_project = s.name

s.add_dependency "savon", "~> 0.9.10"
s.add_dependency "savon", "~> 1.0"
s.add_dependency "rspec", ">= 2.0.0"

s.add_development_dependency "httpclient", "~> 2.1.5"
Expand Down

0 comments on commit d22b7f5

Please sign in to comment.