spec/lib/new/project_spec.rb in new-0.0.14 vs spec/lib/new/project_spec.rb in new-0.0.15
- old
+ new
@@ -8,18 +8,18 @@
let(:project_config) { YAML.load(File.open(File.join(project_dir, New::CONFIG_FILE))).deep_symbolize_keys! }
before do
@tmp_dir = Dir.mktmpdir
FileUtils.cp_r root('spec', 'fixtures', 'custom', 'templates', 'custom_bar_template'), @tmp_dir
- New::Template.stub(:new).and_return(RecursiveOpenStruct.new({ options: {}, dir: template_dir }))
+ allow(New::Template).to receive(:new).and_return(RecursiveOpenStruct.new({ options: {}, dir: template_dir }))
# change directory before creating a project since it uses pwd
Dir.chdir @tmp_dir
project
end
after do
- New::Template.unstub(:new)
+ allow(New::Template).to receive(:new).and_call_original
FileUtils.rm_rf template_dir
FileUtils.rm_rf project_dir
end
it 'should copy the template' do