Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dry up the specs a bit #35

Merged
merged 1 commit into from
May 8, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions spec/cli/authorize_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "authorize" do
before do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/create_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "create a droplet" do
it "with a name" do
stub_request(:get, "https://api.digitalocean.com/droplets/new?api_key=#{api_key}&client_id=#{client_key}&image_id&name=#{droplet_name}&region_id&size_id&ssh_key_ids").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/destroy_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "destroy" do
it "destroys a droplet with a fuzzy name" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/droplets_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "droplets" do
it "shows a list" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/halt_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "halt" do
it "halts a droplet with a fuzzy name" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/images_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "images" do
it "shows a list" do
stub_request(:get, "https://api.digitalocean.com/images?api_key=#{api_key}&client_id=#{client_key}&filter=my_images").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/info_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "show" do
it "shows a droplet with a fuzzy name" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/keys_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "keys" do
it "shows a list" do
stub_request(:get, "https://api.digitalocean.com/ssh_keys?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/regions_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "regions" do
it "shows a list" do
stub_request(:get, "https://api.digitalocean.com/regions?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/restart_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "restarts a droplet" do
it "with a fuzzy name" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/sizes_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "sizes" do
it "shows a list" do
stub_request(:get, "https://api.digitalocean.com/sizes?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/snapshot_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

let(:snapshot_name) { "foo-snapshot" }

before :each do
@cli = Tugboat::CLI.new
end

describe "snapshots a droplet" do
it "with a fuzzy name" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/ssh_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "ssh" do
it "tries to fetch the droplet's IP from the API" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/start_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "start" do
it "starts the droplet with a fuzzy name" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
4 changes: 0 additions & 4 deletions spec/cli/version_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
describe Tugboat::CLI do
include_context "spec"

before :each do
@cli = Tugboat::CLI.new
end

describe "version" do
it "shows the correct version" do

Expand Down
3 changes: 0 additions & 3 deletions spec/middleware/check_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
describe Tugboat::Middleware::CheckConfiguration do
include_context "spec"

let(:app) { lambda { |env| } }
let(:env) { {} }

describe ".call" do
it "raises SystemExit with no configuration" do

Expand Down
3 changes: 0 additions & 3 deletions spec/middleware/check_credentials_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
describe Tugboat::Middleware::CheckCredentials do
include_context "spec"

let(:app) { lambda { |env| } }
let(:env) { {} }

describe ".call" do
it "raises SystemExit with no configuration" do
stub_request(:get, "https://api.digitalocean.com/droplets?api_key=#{api_key}&client_id=#{client_key}").
Expand Down
3 changes: 0 additions & 3 deletions spec/middleware/check_droplet_active_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
describe Tugboat::Middleware::CheckDropletActive do
include_context "spec"

let(:app) { lambda { |env| } }
let(:env) { {} }

describe ".call" do
it "raises an error when droplet is not active" do

Expand Down
3 changes: 0 additions & 3 deletions spec/middleware/check_droplet_inactive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
describe Tugboat::Middleware::CheckDropletInactive do
include_context "spec"

let(:app) { lambda { |env| } }
let(:env) { {} }

describe ".call" do
it "raises an error when droplet is active" do

Expand Down
3 changes: 0 additions & 3 deletions spec/middleware/find_droplet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
describe Tugboat::Middleware::FindDroplet do
include_context "spec"

let(:app) { lambda { |env| } }
let(:env) { {} }

describe ".call" do
it "raises SystemExit with no droplet data" do
expect {described_class.new(app).call(env) }.to raise_error(SystemExit)
Expand Down
3 changes: 0 additions & 3 deletions spec/middleware/inject_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
describe Tugboat::Middleware::InjectConfiguration do
include_context "spec"

let(:app) { lambda { |env| } }
let(:env) { {} }

describe ".call" do

it "loads the configuration into the environment" do
Expand Down
3 changes: 0 additions & 3 deletions spec/middleware/ssh_droplet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
describe Tugboat::Middleware::SSHDroplet do
include_context "spec"

let(:app) { lambda { |env| } }
let(:env) { {} }

before do
Kernel.stub!(:exec)
end
Expand Down
3 changes: 3 additions & 0 deletions spec/shared/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
let(:droplet_ip) { "33.33.33.10" }
let(:droplet_id) { 1234 }
let(:ocean) { DigitalOcean::API.new :client_id => client_key, :api_key =>api_key }
let(:app) { lambda { |env| } }
let(:env) { {} }

before(:each) do
$stdout.sync = true
$stderr.sync = true

@cli = Tugboat::CLI.new

# Set a temprary project path and create fake config.
config.create_config_file(client_key, api_key, ssh_key_path, ssh_user, ssh_port)
Expand Down