Sha256: 98dac59004d07973eb745b1bbf14420d781103826e9c242aac940fcff78f4f51

Contents?: true

Size: 1.35 KB

Versions: 8

Compression:

Stored size: 1.35 KB

Contents

require 'spec_helper'

describe Hieracles::Registry do
	let(:base) { File.expand_path('../../../', __FILE__)}

  describe '.farms' do
    let(:options) do
      { config: 'spec/files/config.yml', basepath: 'spec/files' }
    end
    let(:expected) { [
    		File.join(base, options[:basepath], 'farm_modules', 'dev.pp'),
    		File.join(base, options[:basepath], 'farm_modules', 'dev2.pp'),
    		File.join(base, options[:basepath], 'farm_modules', 'dev4.pp')
  	] }
    before { Hieracles::Config.load options}
    it { expect(Hieracles::Registry.farms Hieracles::Config).to eq expected }
  end

  describe '.nodes' do
    let(:options) do
      { config: 'spec/files/config.yml', basepath: 'spec/files' }
    end
    let(:expected) { [
    		'server.example.com',
    		'server2.example.com',
    		'server3.example.com',
    		'server4.example.com'
  	] }
    before { Hieracles::Config.load options}
    it { expect(Hieracles::Registry.nodes Hieracles::Config).to eq expected }
  end

  describe '.modules' do
    let(:options) do
      { config: 'spec/files/config.yml', basepath: 'spec/files' }
    end
    let(:expected) { [
    		'fake_module',
    		'fake_module2',
    		'fake_module3',
    		'faux_module1',
    		'faux_module2'
  	] }
    before { Hieracles::Config.load options}
    it { expect(Hieracles::Registry.modules Hieracles::Config).to eq expected }
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hieracles-0.1.7 spec/lib/registry_spec.rb
hieracles-0.1.6 spec/lib/registry_spec.rb
hieracles-0.1.5 spec/lib/registry_spec.rb
hieracles-0.1.4 spec/lib/registry_spec.rb
hieracles-0.1.3 spec/lib/registry_spec.rb
hieracles-0.1.2 spec/lib/registry_spec.rb
hieracles-0.1.1 spec/lib/registry_spec.rb
hieracles-0.1.0 spec/lib/registry_spec.rb