Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Ensure configuration is cleared to avoid occasional testing errors.

  • Loading branch information...
commit c03df38f6afe082203a30c0f6830afd3f4581212 1 parent 4f6ae54
Tristan Dunn tristandunn authored

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. +10 0 spec/bartender/request_spec.rb
10 spec/bartender/request_spec.rb
@@ -11,6 +11,10 @@
11 11 Bartender.configuration.private_token = private_token
12 12 end
13 13
  14 + after do
  15 + Bartender.configuration.private_token = nil
  16 + end
  17 +
14 18 it "constructs the request URI" do
15 19 Bartender::Request.delete("/", :option => 1)
16 20 Bartender::Request.should have_received(:uri).with("/", :option => 1, :token => private_token)
@@ -55,12 +59,14 @@
55 59 Bartender.configuration.public_token = public_token
56 60 Bartender::Request.get("/")
57 61 Bartender::Request.should have_received(:uri).with("/", :token => public_token)
  62 + Bartender.configuration.public_token = nil
58 63 end
59 64
60 65 it "allows overriding of configured public token" do
61 66 Bartender.configuration.public_token = public_token
62 67 Bartender::Request.get("/", :token => "x1y2z3")
63 68 Bartender::Request.should have_received(:uri).with("/", :token => "x1y2z3")
  69 + Bartender.configuration.public_token = nil
64 70 end
65 71
66 72 it "makes an API request" do
@@ -91,6 +97,10 @@
91 97 Bartender.configuration.private_token = private_token
92 98 end
93 99
  100 + after do
  101 + Bartender.configuration.private_token = nil
  102 + end
  103 +
94 104 it "constructs the request URI" do
95 105 Bartender::Request.post("/", {}, :option => 1)
96 106 Bartender::Request.should have_received(:uri).with("/", :option => 1, :token => private_token)

0 comments on commit c03df38

Please sign in to comment.
Something went wrong with that request. Please try again.