spec/unit/settings_spec.rb in r10k-3.6.0 vs spec/unit/settings_spec.rb in r10k-3.7.0
- old
+ new
@@ -127,9 +127,21 @@
it 'when not executable raises error' do
expect(File).to receive(:executable?).with('/nonexistent')
expect { subject.evaluate('puppet_path' => '/nonexistent') }.to raise_error(R10K::Settings::Collection::ValidationError)
end
end
+
+ describe 'puppet_conf' do
+ it 'when file raises no error' do
+ allow(File).to receive(:readable?).with('/nonexistent').and_return(true)
+ expect { subject.evaluate('puppet_conf' => '/nonexistent') }.not_to raise_error
+ end
+
+ it 'when not file raises error' do
+ allow(File).to receive(:readable?).with('/nonexistent').and_return(false)
+ expect { subject.evaluate('puppet_conf' => '/nonexistent') }.to raise_error(R10K::Settings::Collection::ValidationError)
+ end
+ end
end
describe "global settings" do
subject { described_class.global_settings }
describe "sources" do