spec/unit/settings_spec.rb in r10k-3.1.1 vs spec/unit/settings_spec.rb in r10k-3.2.0

- old
+ new

@@ -115,9 +115,21 @@ expect(err.errors[:write_lock]).to be_a_kind_of(ArgumentError) expect(err.errors[:write_lock].message).to match(/should be a string containing the reason/) end end end + + describe 'puppet_path' do + it 'when executable raises no error' do + expect(File).to receive(:executable?).with('/nonexistent').and_return(true) + expect { subject.evaluate('puppet_path' => '/nonexistent') }.not_to raise_error + end + + 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 end describe "global settings" do subject { described_class.global_settings } describe "sources" do