Sha256: cc478ad38b2e427441b29f1e7ef98fbfd08d51500d13f601c70b41b5986f8005

Contents?: true

Size: 1.5 KB

Versions: 6

Compression:

Stored size: 1.5 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)
      expect(cmd).to 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)
      expect(cmd).to 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)
      expect(cmd).to receive(:perform)
      Bosh::Bootstrap::Cli::Commands::SSH.stub(:new).and_return(cmd)
      cli.ssh
    end
  end
rescue LoadError
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bosh-bootstrap-0.15.0 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.14.5 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.14.4 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.14.3 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.14.2 spec/unit/cli/bootstrap_spec.rb
bosh-bootstrap-0.14.1 spec/unit/cli/bootstrap_spec.rb