Skip to content

Instantly share code, notes, and snippets.

@julien51
Created September 4, 2009 23:03
Show Gist options
  • Save julien51/181203 to your computer and use it in GitHub Desktop.
Save julien51/181203 to your computer and use it in GitHub Desktop.
require 'test/helper'
describe EventMachine::HttpRequest do
def failed
EventMachine.stop
fail
end
it "should be able to fetch http://www.wral.com/news/rss/4/" do
EventMachine.run {
options = {:head=>{"accept-encoding"=>"deflate"}}
http = EventMachine::HttpRequest.new("http://www.wral.com/news/rss/4/").get(options)
http.errback { failed }
http.callback {
http.response.should == "doh!"
EventMachine.stop
}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment