Sha256: 7ccaad2da4edb1b35685c5f67b13832e6919909a0d99e30284031c03bb523375

Contents?: true

Size: 483 Bytes

Versions: 1

Compression:

Stored size: 483 Bytes

Contents

module ColorParser
  class TestRequest
    def initialize(params={})
    end
    
    # Read in fixture file instead of url
    def get(url)
      begin
        uri = URI.parse(url.strip)
      rescue URI::InvalidURIError
        uri = URI.parse(URI.escape(url.strip))
      end

      # simple hack to read in fixtures instead of url for tests
      fixture = "#{File.dirname(__FILE__)}/../test/fixtures#{uri.path}"
      File.read(fixture) if File.exist?(fixture)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
color_parser-0.0.2 test/test_request.rb