Permalink
Browse files

Ensure configuration is cleared to avoid occasional testing errors.

  • Loading branch information...
1 parent 4f6ae54 commit c03df38f6afe082203a30c0f6830afd3f4581212 @tristandunn tristandunn committed Dec 11, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 spec/bartender/request_spec.rb
@@ -11,6 +11,10 @@
Bartender.configuration.private_token = private_token
end
+ after do
+ Bartender.configuration.private_token = nil
+ end
+
it "constructs the request URI" do
Bartender::Request.delete("/", :option => 1)
Bartender::Request.should have_received(:uri).with("/", :option => 1, :token => private_token)
@@ -55,12 +59,14 @@
Bartender.configuration.public_token = public_token
Bartender::Request.get("/")
Bartender::Request.should have_received(:uri).with("/", :token => public_token)
+ Bartender.configuration.public_token = nil
end
it "allows overriding of configured public token" do
Bartender.configuration.public_token = public_token
Bartender::Request.get("/", :token => "x1y2z3")
Bartender::Request.should have_received(:uri).with("/", :token => "x1y2z3")
+ Bartender.configuration.public_token = nil
end
it "makes an API request" do
@@ -91,6 +97,10 @@
Bartender.configuration.private_token = private_token
end
+ after do
+ Bartender.configuration.private_token = nil
+ end
+
it "constructs the request URI" do
Bartender::Request.post("/", {}, :option => 1)
Bartender::Request.should have_received(:uri).with("/", :option => 1, :token => private_token)

0 comments on commit c03df38

Please sign in to comment.