Skip to content

Commit

Permalink
Merge remote branch 'rapportive-oss/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
bblimke committed Jan 12, 2011
2 parents ed9ff32 + 3fbba40 commit a4ad647
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.6.1
1.6.2.rapportive
2 changes: 1 addition & 1 deletion lib/webmock/http_lib_adapters/em_http_request.rb
Expand Up @@ -10,7 +10,7 @@ class WebMockHttpRequest < EventMachine::HttpRequest
class WebMockHttpClient < EventMachine::HttpClient

def setup(response, uri, error = nil)
@uri = uri
@last_effective_url = @uri = uri
if error
on_error(error)
fail(self)
Expand Down
21 changes: 21 additions & 0 deletions spec/em_http_request_spec.rb
Expand Up @@ -30,5 +30,26 @@
http_request(:get, "http://www.example.com/?x=3", :query => "a[]=b&a[]=c").body.should == "abc"
end

describe "mocking EM::HttpClient API" do
before { stub_http_request(:get, "www.example.com/") }
subject do
client = nil
EM.run do
client = EventMachine::HttpRequest.new('http://www.example.com/').get
client.callback { EM.stop }
client.errback { failed }
end
client
end

it 'should support #uri' do
subject.uri.should == Addressable::URI.parse('http://www.example.com/')
end

it 'should support #last_effective_url' do
subject.last_effective_url.should == Addressable::URI.parse('http://www.example.com/')
end
end

end
end
4 changes: 2 additions & 2 deletions webmock.gemspec
Expand Up @@ -5,11 +5,11 @@

Gem::Specification.new do |s|
s.name = %q{webmock}
s.version = "1.6.1"
s.version = "1.6.2.rapportive"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Bartosz Blimke"]
s.date = %q{2010-11-13}
s.date = %q{2011-01-10}
s.description = %q{WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.}
s.email = %q{bartosz.blimke@gmail.com}
s.extra_rdoc_files = [
Expand Down

0 comments on commit a4ad647

Please sign in to comment.