Sha256: 7ca47884d2c4d0dc10c1f2a53ad6f9daee3e083217bef691550392e073c2bbd5

Contents?: true

Size: 231 Bytes

Versions: 4

Compression:

Stored size: 231 Bytes

Contents

require 'open-uri'

class URI::HTTP

  class << self
    attr_accessor :responses, :uris
  end

  alias original_open open

  def open
    self.class.uris << self.to_s
    yield StringIO.new(self.class.responses.shift)
  end

end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
geocoder-us-1.0.0 test/uri_stub.rb
google-geocode-1.0.0 test/uri_stub.rb
google-geocode-1.1.0 test/uri_stub.rb
yahoo-1.0.0 test/uri_stub.rb