Sha256: b8d34cc6726bdfaf96efbcf91329c60e15c2e7741c449539f60f043f301adc89

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 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.")

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

  def puts(output_string = "\n")
    Output.puts(output_string)
  end
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

1 entries across 1 versions & 1 rubygems

Version Path
httping-1.0.0 spec/spec_helper.rb