spec/unit/action/puppetfile/cri_runner_spec.rb in r10k-2.6.9 vs spec/unit/action/puppetfile/cri_runner_spec.rb in r10k-3.0.0

- old
+ new

@@ -29,35 +29,17 @@ expect(cri_runner).to receive(:wd).and_return('/some/nonexistent') expect(cri_runner.handle_opts({})).to include(:root => '/some/nonexistent') end describe "for the moduledir" do - before do - allow(cri_runner).to receive(:env).and_return({'PUPPETFILE_DIR' => '/some/nonexistent/modules'}) - end - - it "sets the option from the environment when the cli option is not given" do - opts = {} - expect(cri_runner.handle_opts(opts)).to include(:moduledir => '/some/nonexistent/modules') - end - - it "doesn't set the option from the environment when the cli option is given" do + it "sets the option from the cli option if given" do opts = {:moduledir => '/some/other/nonexistent/modules'} expect(cri_runner.handle_opts(opts)).to include(:moduledir => '/some/other/nonexistent/modules') end end describe "for the puppetfile path" do - before do - allow(cri_runner).to receive(:env).and_return({'PUPPETFILE' => '/some/nonexistent/Puppetfile'}) - end - - it "sets the option from the environment when the cli option is not given" do - opts = {} - expect(cri_runner.handle_opts(opts)).to include(:puppetfile => '/some/nonexistent/Puppetfile') - end - - it "doesn't set the option from the environment when the cli option is given" do + it "sets the option from the cli option if given" do opts = {:puppetfile => '/some/other/nonexistent/modules'} expect(cri_runner.handle_opts(opts)).to include(:puppetfile => '/some/other/nonexistent/modules') end end end