Sha256: 0bc4df1560039ef08f3c6c46f9f2fcc73f0509fc20d66ef7240af6ff49540bbd

Contents?: true

Size: 1.1 KB

Versions: 29

Compression:

Stored size: 1.1 KB

Contents

require "spec_helper"

describe "brightbox cloudips" do

  describe "map" do
    let(:output) { FauxIO.new { Brightbox.run(argv) } }
    let(:stdout) { output.stdout }
    let(:stderr) { output.stderr }

    before do
      config = config_from_contents(USER_APP_CONFIG_CONTENTS)

      # Setup in the VCR recordings
      cache_access_token(config, "f83da712e6299cda953513ec07f7a754f747d727")
    end

    context "when destination is a server ID", vcr: true do
      let(:argv) { %w(cloudips map cip-12345 srv-12345) }
      let(:target) { "int-12345" }

      it "passes the interface identifier to the API" do
        expect_any_instance_of(Brightbox::CloudIP).to receive(:map).with(target).and_call_original
        expect(stdout).to include("mapped")
      end
    end

    context "when destination is another value", vcr: true do
      let(:target) { "res-12345" }
      let(:argv) { %w(cloudips map cip-12345 res-12345) }

      it "passes the identifier to the API" do
        expect_any_instance_of(Brightbox::CloudIP).to receive(:map).with(target)
        expect(stderr).to include(target)
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
brightbox-cli-3.3.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-3.2.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-3.1.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-3.0.1 spec/commands/cloudips/map_spec.rb
brightbox-cli-3.0.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.12.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.11.2 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.11.1 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.11.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.10.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.9.3 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.9.2 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.9.1 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.9.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.8.2 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.8.1 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.8.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.7.1 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.7.0 spec/commands/cloudips/map_spec.rb
brightbox-cli-2.6.0 spec/commands/cloudips/map_spec.rb