Skip to content

Commit

Permalink
Merge 4435c38 into 7f93670
Browse files Browse the repository at this point in the history
  • Loading branch information
petems committed Sep 3, 2014
2 parents 7f93670 + 4435c38 commit 030ce0c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions spec/middleware/inject_client_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require 'spec_helper'

describe Tugboat::Middleware::InjectClient do
include_context "spec"

let(:tmp_path) { project_path + "/tmp/tugboat" }

before :each do
config = Tugboat::Configuration.instance
env["config"] = config
end

describe ".call" do

it "loads the client into the environment" do
described_class.new(app).call(env)

env["ocean"].should be_a DigitalOcean::API
end

it "creates a client with values from config file" do
DigitalOcean::API.should_receive(:new).with(hash_including(:client_id=>"foo", :api_key=>"bar"))

described_class.new(app).call(env)
end

end

end

0 comments on commit 030ce0c

Please sign in to comment.