spec/lib/node_spec.rb in hieracles-0.0.1 vs spec/lib/node_spec.rb in hieracles-0.0.2

- old
+ new

@@ -16,10 +16,11 @@ options.merge({ params: 'key1=value1;key2=value2' }) } let(:node) { Hieracles::Node.new 'server.example.com', extraoptions } let(:expected) { { + classes: ['dev'], fqdn: 'server.example.com', country: 'fr', datacenter: 'equinix', farm: 'dev', key1: 'value1', @@ -40,10 +41,11 @@ let(:node) { Hieracles::Node.new 'server.example.com', options } describe '.new' do let(:expected) { { + classes: ['dev'], fqdn: 'server.example.com', country: 'fr', datacenter: 'equinix', farm: 'dev' } @@ -140,19 +142,34 @@ end context "no farm file found" do let(:node) { Hieracles::Node.new 'server3.example.com', options } it { expect { node.modules }.to raise_error(RuntimeError) } end + context "multiple classes included" do + let(:node) { Hieracles::Node.new 'server4.example.com', options } + let(:expected) { + { + "fake_module" => "modules/fake_module", + "fake_module2" => "modules/fake_module2", + "fake_module4" => nil, + "faux_module1" => "modules/faux_module1", + "faux_module2" => "modules/faux_module2" + } + } + it { expect(node.modules).to eq expected } + end end describe '.info' do let(:expected) { { + classes: ['dev'], fqdn: 'server.example.com', datacenter: 'equinix', country: 'fr', farm: 'dev' } } it { expect(node.info).to eq expected } end + end end