Sha256: 608e471c91e3f3b9aaeed89f8bdbb262b62ffe5c48a4380b1e0981420de63824

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

Contents

require 'spec'
require File.join(File.dirname(__FILE__), '../lib/httping')


require 'fakeweb'
FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:any, "http://www.example.com", :body => "hey there.")
FakeWeb.register_uri(:any, "https://www.example.com", :body => "hey there.")
FakeWeb.register_uri(:any, "http://www.example.com/search?q=test", :body => "hey there.")

class Object
  def exit(status_code = nil)
    @status = status_code
  end

  def puts(output_string = "\n")
    Output.puts(output_string)
  end
  
  alias print puts
end

class Output 
  class << self
    def puts(output_string)
      @output = [] if @output.nil?
      @output << output_string
    end
  
    def to_s
      @output.join("\n") if @output
    end
    
    def clear
      @output.clear if @output
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
httping-1.3.0 spec/spec_helper.rb
httping-1.1.0 spec/spec_helper.rb
httping-1.0.1 spec/spec_helper.rb