Created
May 25, 2013 15:01
-
-
Save jvanbaarsen/5649380 to your computer and use it in GitHub Desktop.
client_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '../../spec_helper' | |
require 'digitalocean/client.rb' | |
describe Digitalocean::Client do | |
subject {Digitalocean::Client.new(:client_id => client_id, :api_key => api_key)} | |
let (:client_id) {CLIENT_ID} | |
let (:api_key) {API_KEY} | |
it {should respond_to(:droplets)} | |
it {should respond_to(:regions)} | |
it {should respond_to(:images)} | |
it {should respond_to(:sizes)} | |
describe ".new" do | |
it "should return an instance when called with the right params" do | |
client = Digitalocean::Client.new(:client_id => client_id, :api_key => api_key) | |
client.should be_instance_of(Digitalocean::Client) | |
end | |
it "should raise an exception when client_id is not given" do | |
expect {Digitalocean::Client.new(:client_id => client_id)}.to raise_error(ArgumentError) | |
end | |
it "should raise an exception when api_key is not given" do | |
expect {Digitalocean::Client.new(:api_key => api_key) }.to raise_error(ArgumentError) | |
end | |
end | |
describe ".droplets" do | |
it "should return an instance" do | |
subject.droplets.should be_instance_of(Digitalocean::Resource::Droplet) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment