Sha256: cd074b6c8e1a0f85aa8c7e062835d459ede38244dd8a16d01231b6f8cafed4b5

Contents?: true

Size: 1.32 KB

Versions: 22

Compression:

Stored size: 1.32 KB

Contents

require "spec_helper"
require "fog/bin"
require "helpers/bin"

describe Bluebox do
  include Fog::BinSpec

  let(:subject) { Bluebox }

  describe "#services" do
    it "includes all services" do
      assert_includes Bluebox.services, :compute
      assert_includes Bluebox.services, :dns
      assert_includes Bluebox.services, :blb
    end
  end

  describe "#class_for" do
    describe "when requesting compute service" do
      it "returns correct class" do
        assert_equal Fog::Compute::Bluebox, Bluebox.class_for(:compute)
      end
    end

    describe "when requesting dns service" do
      it "returns correct class" do
        assert_equal Fog::DNS::Bluebox, Bluebox.class_for(:dns)
      end
    end

    describe "when requesting blb service" do
      it "returns correct class" do
        assert_equal Fog::Bluebox::BLB, Bluebox.class_for(:blb)
      end
    end
  end

  describe "#[]" do
    describe "when requesting compute service" do
      it "returns instance" do
        Fog::Compute::Bluebox.stub(:new, "instance") do
          assert_equal "instance", Bluebox[:compute]
        end
      end
    end

    describe "when requesting dns service" do
      it "returns instance" do
        Fog::DNS::Bluebox.stub(:new, "instance") do
          assert_equal "instance", Bluebox[:dns]
        end
      end
    end
  end
end

Version data entries

22 entries across 20 versions & 4 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/spec/fog/bin/bluebox_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/spec/fog/bin/bluebox_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/spec/fog/bin/bluebox_spec.rb
fog-1.42.1 spec/fog/bin/bluebox_spec.rb
fog-2.0.0 spec/fog/bin/bluebox_spec.rb
fog-1.42.0 spec/fog/bin/bluebox_spec.rb
fog-1.41.0 spec/fog/bin/bluebox_spec.rb
fog-1.40.0 spec/fog/bin/bluebox_spec.rb
fog-1.39.0 spec/fog/bin/bluebox_spec.rb
fog-digitalocean-0.1.0 spec/fog/bin/bluebox_spec.rb
fog-1.38.0 spec/fog/bin/bluebox_spec.rb
fog-1.37.0 spec/fog/bin/bluebox_spec.rb
fog-1.36.0 spec/fog/bin/bluebox_spec.rb
fog-1.35.0 spec/fog/bin/bluebox_spec.rb
fog-2.0.0.pre.0 spec/fog/bin/bluebox_spec.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/spec/fog/bin/bluebox_spec.rb
fog-1.34.0 spec/fog/bin/bluebox_spec.rb
fog-1.33.0 spec/fog/bin/bluebox_spec.rb
fog-1.32.0 spec/fog/bin/bluebox_spec.rb
fog-1.31.0 spec/fog/bin/bluebox_spec.rb