spec/unit/module_loader/puppetfile_spec.rb in r10k-3.13.0 vs spec/unit/module_loader/puppetfile_spec.rb in r10k-3.14.0

- old
+ new

@@ -165,10 +165,11 @@ end it 'should disable and not add modules that conflict with the environment' do env = instance_double('R10K::Environment::Base') mod = instance_double('R10K::Module::Base', name: 'conflict', origin: :puppetfile, 'origin=': nil) + allow(env).to receive(:name).and_return('conflict') loader = R10K::ModuleLoader::Puppetfile.new(basedir: basedir, environment: env) allow(env).to receive(:'module_conflicts?').with(mod).and_return(true) allow(mod).to receive(:spec_deletable=) expect(R10K::Module).to receive(:from_metadata).with('conflict', anything, anything, anything).and_return(mod) @@ -185,10 +186,12 @@ end context 'when belonging to an environment' do let(:env_contents) { ['env1', 'env2' ] } let(:env) { double(:environment, desired_contents: env_contents) } - + before { + allow(env).to receive(:name).and_return('env1') + } subject { R10K::ModuleLoader::Puppetfile.new(basedir: '/test/basedir', environment: env) } it "includes environment's desired_contents" do expect(subject.send(:determine_purge_exclusions, managed_dirs)).to match_array(managed_dirs + env_contents) end