Sha256: bc865c3203b4923d03539701c26fbc7a18d7492bc335869c0b40d05bcd33d0d9

Contents?: true

Size: 617 Bytes

Versions: 3

Compression:

Stored size: 617 Bytes

Contents

require 'httparty'
require 'minitest/autorun'

class Google
  include HTTParty
  format :html
end

# globally set to our moxie instance.
Google.http_proxy 'localhost', 9292


describe Google do
  it "should handle google crashes" do
    # setup responses at moxie.
    HTTParty.post('http://localhost:9292/__setup__', 
                  :body=>{
                    :mock_text=>'stub_request(:get, "http://google.com?q=moxie").to_return(:status=>401)'
                  })

    r = Google.get("http://google.com?q=moxie")

    # betcha didn't expect that one from google Search!
    r.code.must_equal 401
  end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
moxy-0.0.3 examples/testing_with_minitest.rb
moxy-0.0.2 examples/testing_with_minitest.rb
moxy-0.0.1 examples/testing_with_minitest.rb