Sha256: 0783ee792b351e7fc606bba1b761634b43f1c9c96d0fe28e149a18f48c555802
Contents?: true
Size: 1.26 KB
Versions: 20
Compression:
Stored size: 1.26 KB
Contents
require "spec_helper" describe "brightbox sql instances" do describe "snapshot" 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 database server active", vcr: true do let(:argv) { %w(sql instances snapshot dbs-12345) } let(:expected_args) { { :allow_access => ["10.0.0.0"] } } it "correctly sends API parameters" do expect_any_instance_of(Brightbox::DatabaseServer).to receive(:snapshot).and_call_original expect(stderr).to include("Creating snapshot for dbs-12345") end end context "when database server can not be snapshotted", vcr: true do let(:argv) { %w(sql instances snapshot dbs-12345) } it "reports an error to the user" do expect_any_instance_of(Brightbox::DatabaseServer).to receive(:snapshot).and_call_original expect(stderr).to include("Creating snapshot for dbs-12345") expect(stderr).to include("ERROR: Unable to action the request due to conflicting states") end end end end
Version data entries
20 entries across 20 versions & 1 rubygems