spec/unit/loader_spec.rb in a9n-0.3.1 vs spec/unit/loader_spec.rb in a9n-0.3.2

- old
+ new

@@ -87,14 +87,17 @@ context "with different data" do before do expect(described_class).to receive(:load_yml).with(subject.example_file, env).and_return(example_config) expect(described_class).to receive(:load_yml).with(subject.local_file, env).and_return(local_config) end - it "raises expection" do + + let(:missing_variables_names) { example_config.keys - local_config.keys } + + it "raises expection with missing variables names" do expect { subject.load - }.to raise_error(A9n::MissingConfigurationVariables) + }.to raise_error(A9n::MissingConfigurationVariables, /#{missing_variables_names.join(', ')}/) end end end end @@ -117,9 +120,15 @@ end before { ENV["DWARF"] = "erbized dwarf" } + + context 'when file has erb extension' do + let(:file_path) { File.join(root, "config/a9n/cloud.yml.erb") } + + it_behaves_like "non-empty config file" + end context "having env and defaults data" do let(:file_path) { File.join(root, "config/configuration.yml") } it_behaves_like "non-empty config file"