spec/embedly/api_spec.rb in embedly-1.7.1 vs spec/embedly/api_spec.rb in embedly-1.8.0
- old
+ new
@@ -1,7 +1,8 @@
require "spec_helper"
+
module Embedly
describe API do
let(:api) { API.new :key => ENV['EMBEDLY_KEY'], :secret => ENV['EMBEDLY_SECRET'] }
describe "logger" do
@@ -15,9 +16,31 @@
end
it "logs if debug is enabled" do
api.oembed :url => 'http://blog.doki-pen.org/'
io.string.should =~ %r{.*DEBUG -- : .*}
+ end
+ end
+
+ describe "requesters" do
+ describe "net/http" do
+ before do
+ Embedly.configure { |c| c.request_with :net_http }
+ end
+
+ it "sets the correct request adapter" do
+ api.request.should be_a(Embedly::NetHTTP::Request)
+ end
+ end
+
+ describe "typhoeus" do
+ before do
+ Embedly.configure { |c| c.request_with :typhoeus }
+ end
+
+ it "sets the correct request adapter" do
+ api.request.should be_a(Embedly::Typhoeus::Request)
+ end
end
end
end
end