Sha256: 99344fb2bc3d6ddbd24041534df258f39187ce30a1b7c49318dee39a11323d1a

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'
require 'ironfan'

describe Ironfan::Dsl::MachineManifest do
  context 'it disregards whether values are strings or symbols' do
    before(:each) do
      Ironfan::Dsl::Component.template(%w[baz bif]) do
        collection :bams, Symbol
        magic :pow, Whatever
      end
    end

    def comparable_manifest(hsh)
      Ironfan::Dsl::MachineManifest.receive(components: [Ironfan::Dsl::Component::BazBif.new(hsh)]).to_comparable
    end

    it 'when those values are contained in an array of within its serialization' do
      comparable_manifest(bam: [:a, :b, :c]).should == comparable_manifest(bam: %w[a b c])
      comparable_manifest(pow: [:a, :b, :c]).should == comparable_manifest(pow: %w[a b c])
    end
    it 'when those values are contained in hash within its serialization' do
      comparable_manifest(pow: {a: 'a'}).should == comparable_manifest(pow: {'a' => :a})
    end
    it 'correctly stores the chef environment' do
      node = Chef::Node.json_create('chef_environment' => 'buzi', 'recipes' => [])
      Ironfan::Dsl::MachineManifest.from_remote(nil, nil, nil, node, nil, nil, nil, nil, nil).environment.to_s.should == 'buzi'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ironfan-5.0.0 spec/ironfan/manifest_spec.rb