Sha256: 6a4b0f24c90f5e49b99c7168828d6af1b1f79d096bb873f630ae7802bc270135

Contents?: true

Size: 1.27 KB

Versions: 20

Compression:

Stored size: 1.27 KB

Contents

require "spec_helper"
require "fog/brightbox/models/compute/database_server"

describe Brightbox::DatabaseServer do

  describe ".clean_arguments" do
    let(:parameters) { Brightbox::DatabaseServer.clean_arguments(arguments) }

    context "when no arguments" do
      let(:arguments) { {} }

      it { expect(parameters.keys).to be_empty }
    end

    context "when --allow-access=10.0.0.0" do
      let(:arguments) { { "allow-access" => "10.0.0.0" } }

      it { expect(parameters[:allow_access]).to eql(["10.0.0.0"]) }
    end

    context "when --allow-access=10.0.0.0,11.0.0.0" do
      let(:arguments) { { "allow-access" => "10.0.0.0,11.0.0.0" } }

      it { expect(parameters[:allow_access]).to eql(%w(10.0.0.0 11.0.0.0)) }
    end

    context "when --maintenance-weekday=4" do
      let(:arguments) { { "maintenance-weekday" => "4" } }

      it { expect(parameters[:maintenance_weekday]).to eql("4") }
    end

    context "when --maintenance-weekday=wednesday" do
      let(:arguments) { { "maintenance-weekday" => "3" } }

      it { expect(parameters[:maintenance_weekday]).to eql("3") }
    end

    context "when --maintenance-weekday=" do
      let(:arguments) { { "maintenance-weekday" => "" } }

      it { expect(parameters[:maintenance_weekday]).to be_nil }
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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