Sha256: 44903dc9ae8a57611066c5bde13dcf3becb1387819f0d6029ad72fa4af8cac90

Contents?: true

Size: 583 Bytes

Versions: 8

Compression:

Stored size: 583 Bytes

Contents

require 'test_helper'

class TestMissingOpenURI < Test::Unit::TestCase

  def setup
    super
    @saved_open_uri = OpenURI
    Object.send(:remove_const, :OpenURI)
  end

  def teardown
    super
    Object.const_set(:OpenURI, @saved_open_uri)
  end


  def test_register_using_exception_without_open_uri
    # regression test for Responder needing OpenURI::HTTPError to be defined
    FakeWeb.register_uri(:get, "http://example.com/", :exception => StandardError)
    assert_raises(StandardError) do
      Net::HTTP.start("example.com") { |http| http.get("/") }
    end
  end

end

Version data entries

8 entries across 8 versions & 5 rubygems

Version Path
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/fakeweb-1.3.0/test/test_missing_open_uri.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/fakeweb-1.3.0/test/test_missing_open_uri.rb
putio-0.0.1.pre2 development/ruby/1.8/gems/fakeweb-1.3.0/test/test_missing_open_uri.rb
putio-0.0.1.pre development/ruby/1.8/gems/fakeweb-1.3.0/test/test_missing_open_uri.rb
cotweet-fakeweb-1.3.0 test/test_missing_open_uri.rb
fakeweb-1.3.0 test/test_missing_open_uri.rb
corntrace-fakeweb-1.2.9 test/test_missing_open_uri.rb
fakeweb-1.2.8 test/test_missing_open_uri.rb