Sha256: b990b12dadb1be1b849456cb18ffc20f51bb4a330a2fc3bd51e101e18402c0bf

Contents?: true

Size: 1.49 KB

Versions: 19

Compression:

Stored size: 1.49 KB

Contents

# Copyright (c) 2012-2013 Stark & Wayne, LLC

# By default, this bosh plugin test does not run. To enable it, include the `bosh_cli` gem
# in the Gemfile.
begin
  require "cli" # bosh CLI
  require "bosh/cli/commands/bootstrap" # "bosh bootstrap COMMAND" commands added to bosh CLI

  require "bosh-bootstrap/cli/commands/deploy"
  require "bosh-bootstrap/cli/commands/delete"
  require "bosh-bootstrap/cli/commands/ssh"
  describe Bosh::Cli::Command::Bootstrap do
    include FileUtils

    before do
      FileUtils.mkdir_p(@stemcells_dir = File.join(Dir.mktmpdir, "stemcells"))
      FileUtils.mkdir_p(@cache_dir = File.join(Dir.mktmpdir, "cache"))
    end

    let(:cli) do
      cli = Bosh::Cli::Command::Bootstrap.new(nil)
      cli.add_option(:non_interactive, true)
      cli.add_option(:cache_dir, @cache_dir)
      cli
    end

    it "runs deploy command" do
      cmd = double(Bosh::Bootstrap::Cli::Commands::Deploy)
      cmd.should_receive(:perform)
      Bosh::Bootstrap::Cli::Commands::Deploy.stub(:new).and_return(cmd)
      cli.deploy
    end

    it "runs delete command" do
      cmd = double(Bosh::Bootstrap::Cli::Commands::Delete)
      cmd.should_receive(:perform)
      Bosh::Bootstrap::Cli::Commands::Delete.stub(:new).and_return(cmd)
      cli.delete
    end

    it "runs ssh command" do
      cmd = double(Bosh::Bootstrap::Cli::Commands::SSH)
      cmd.should_receive(:perform)
      Bosh::Bootstrap::Cli::Commands::SSH.stub(:new).and_return(cmd)
      cli.ssh
    end
  end
rescue LoadError
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
bosh-bootstrap-0.14.0 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.13.2 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.13.1 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.13.0 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.12.0 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.15 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.14 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.13 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.12 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.11 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.9 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.8 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.7 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.6 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.5 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.4 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.3 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.2 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.11.1 spec/unit/cli/bootstrap_spec.rb