spec/lib/registry_spec.rb in hieracles-0.3.2 vs spec/lib/registry_spec.rb in hieracles-0.3.3
- old
+ new
@@ -52,6 +52,41 @@
] }
let(:config) { Hieracles::Config.new options }
it { expect(Hieracles::Registry.modules config).to eq expected }
end
+ describe '.nodes_data' do
+ let(:options) do
+ {
+ config: 'spec/files/config.yml',
+ basepath: 'spec/files'
+ }
+ end
+ let(:expected) {
+ {
+ 'server.example.com' => {
+ 'country' => 'fr',
+ 'datacenter' => 'equinix',
+ 'farm' => 'dev'
+ },
+ 'server2.example.com' => {
+ 'country' => 'fr',
+ 'datacenter' => 'equinix',
+ 'farm' => 'dev2'
+ },
+ 'server3.example.com' => {
+ 'country' => 'fr',
+ 'datacenter' => 'equinix',
+ 'farm' => 'dev3'
+ },
+ 'server4.example.com' => {
+ 'country' => 'fr',
+ 'datacenter' => 'equinix',
+ 'farm' => 'dev2'
+ }
+ }
+ }
+ let(:config) { Hieracles::Config.new options }
+ it { expect(Hieracles::Registry.nodes_data config).to eq expected }
+ end
+
end