spec/lib/registry_spec.rb in hieracles-0.3.0 vs spec/lib/registry_spec.rb in hieracles-0.3.1

- old
+ new

@@ -8,17 +8,17 @@ { config: 'spec/files/config.yml', basepath: 'spec/files' } end + let(:config) { Hieracles::Config.new options } let(:expected) { [ - File.join(Hieracles::Config.basepath, 'farm_modules', 'dev.pp'), - File.join(Hieracles::Config.basepath, 'farm_modules', 'dev2.pp'), - File.join(Hieracles::Config.basepath, 'farm_modules', 'dev4.pp') - ] } - before { Hieracles::Config.load options} - it { expect(Hieracles::Registry.farms Hieracles::Config).to eq expected } + 'dev', + 'dev2', + 'dev4' + ] } + it { expect(Hieracles::Registry.farms config).to eq expected } end describe '.nodes' do let(:options) do { @@ -30,12 +30,12 @@ '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 } + let(:config) { Hieracles::Config.new options } + it { expect(Hieracles::Registry.nodes config).to eq expected } end describe '.modules' do let(:options) do { @@ -48,10 +48,10 @@ 'fake_module2', 'fake_module3', 'faux_module1', 'faux_module2' ] } - before { Hieracles::Config.load options} - it { expect(Hieracles::Registry.modules Hieracles::Config).to eq expected } + let(:config) { Hieracles::Config.new options } + it { expect(Hieracles::Registry.modules config).to eq expected } end end