23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/ebayr/test_helper.rb', line 23
def stub_ebay_call!(call, content, &block)
puts <<DEPRECATION
stub_ebay_call! is deprecated, and will be removed in a future release. Please
use Ruby techniques to stub eBay calls your way. See the wiki for details.
DEPRECATION
content = Ebayr.xml(content) unless content.is_a?(String)
_allow_net_connect_ = FakeWeb.allow_net_connect?
FakeWeb.allow_net_connect = false
body = <<-XML
<#{call}Response>
#{Ebayr.xml(:Ack => "Success")}
#{content}
</#{call}Response>
XML
FakeWeb.register_uri(:any, Ebayr.uri, :body => body)
yield
FakeWeb.clean_registry
FakeWeb.allow_net_connect = _allow_net_connect_
end
|