Sha256: b00ab825a1af8b52a79706336bb13e905469735ac4afa3131154b337dfa649c8

Contents?: true

Size: 1.04 KB

Versions: 18

Compression:

Stored size: 1.04 KB

Contents

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

describe Brightbox::DatabaseServer do
  describe "#maintenance_window" do
    let(:fog_model) { Fog::Brightbox::Compute::DatabaseServer.new(fog_settings) }
    let(:dbs) { Brightbox::DatabaseServer.new(fog_model) }

    context "when default values" do
      let(:fog_settings) do
        {
          "maintenance_weekday" => 0,
          "maintenance_hour" => 6
        }
      end

      it "returns 'Sunday 06:00 UTC'" do
        expect(dbs.maintenance_window).to eql("Sunday 06:00 UTC")
      end
    end

    context "when non standard values" do
      let(:fog_settings) do
        {
          "maintenance_weekday" => 6,
          "maintenance_hour" => 23
        }
      end

      it "returns 'Saturday 23:00 UTC'" do
        expect(dbs.maintenance_window).to eql("Saturday 23:00 UTC")
      end
    end

    context "when not initialised" do
      let(:fog_settings) { {} }

      it "returns nil" do
        expect(dbs.maintenance_window).to be_nil
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/database_server/maintenance_window_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/database_server/maintenance_window_spec.rb