Sha256: 169ea88bbd9248602b4e4ab859ca7bcf9d685b9780ef898a91cfd2d800096b4d

Contents?: true

Size: 988 Bytes

Versions: 6

Compression:

Stored size: 988 Bytes

Contents

require 'logical-construct/target/platforms'

describe LogicalConstruct do
  after :each do
    ENV['LOGCON_DEPLOYMENT_PLATFORM'] = nil
    $DEPLOYMENT_PLATFORM = nil
  end

  describe "Platform()" do
    it "should fail for unset plaform" do
      expect do
        LogicalConstruct::Platform()
      end.to raise_error(KeyError)
    end

    it "should succeed for ENV VirtualBox" do
      ENV['LOGCON_DEPLOYMENT_PLATFORM'] = 'VirtualBox'
      LogicalConstruct::Platform().should == LogicalConstruct::VirtualBox
    end

    it "should succeed for global VirtualBox" do
      $DEPLOYMENT_PLATFORM = 'VirtualBox'
      LogicalConstruct::Platform().should == LogicalConstruct::VirtualBox
    end
  end

  describe "including VirtualBox" do
    before :each do
      ENV['LOGCON_DEPLOYMENT_PLATFORM'] = 'VirtualBox'
    end

    it "should make ChefConfig available" do
      LogicalConstruct::Platform()::ChefConfig.should == ::LogicalConstruct::VirtualBox::ChefConfig
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
logical-construct-0.0.5 spec/target/platforms.rb
logical-construct-0.0.4 spec/target/platforms.rb
logical-construct-0.0.3 spec/target/platforms.rb
logical-construct-0.0.2 spec/target/platforms.rb
logical-construct-0.0.1 spec/target/platforms.rb
logical-construct-0.0.1.localtesting spec/target/platforms.rb