Sha256: 56b283050625356cc1ae19f20a09c20edec683ef7a25a750b7b45105cd0112f5

Contents?: true

Size: 823 Bytes

Versions: 7

Compression:

Stored size: 823 Bytes

Contents

require "spec_helper"

describe Brightbox::Server do

  describe "#create" do
    context "when account limit reached" do
      it "should print error if account limit reached" do
        options = {
          :image_id => "img-12345",
          :name => "medium servers",
          :zone_id => "",
          :user_data => nil,
          :flavor_id => "typ-12345"
        }
        expect(Brightbox::Server).to receive(:create).and_raise(limit_exceeded_exception)
        error = nil
        begin
          Brightbox::Server.create(options)
        rescue Exception => e
          error = Brightbox::ErrorParser.new(e)
        end
        output = FauxIO.new { error.pretty_print() }
        expect(output.stderr).to match(/Account limit reached, please contact support for more information/i)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
brightbox-cli-1.2.2 spec/unit/brightbox/server/create_spec.rb
brightbox-cli-1.2.1 spec/unit/brightbox/server/create_spec.rb
brightbox-cli-1.2.0 spec/unit/brightbox/server/create_spec.rb
brightbox-cli-1.1.0 spec/unit/brightbox/server/create_spec.rb
brightbox-cli-1.0.0 spec/unit/brightbox/server/create_spec.rb
brightbox-cli-1.0.0.rc2 spec/unit/brightbox/server/create_spec.rb
brightbox-cli-1.0.0.rc1 spec/unit/brightbox/server/create_spec.rb