spec/lib/new/template_spec.rb in new-0.0.14 vs spec/lib/new/template_spec.rb in new-0.0.15

- old
+ new

@@ -3,15 +3,15 @@ describe New::Template do subject(:template){ New::Template.new type, 'new_template' } let(:type){ :foo_template } before do - New::Template.any_instance.stub(:interpolate) + allow_any_instance_of(New::Template).to receive :interpolate end after do - New::Template.any_instance.unstub(:interpolate) + allow_any_instance_of(New::Template).to receive :interpolate end describe '#template_dir' do context 'with a default template' do let(:type){ :foo_template } @@ -27,11 +27,11 @@ it 'should return the custom template path' do expect(template.send(:template_dir)).to eq File.join(New::CUSTOM_DIR, New::TEMPLATES_DIR_NAME, type.to_s) end it 'should set the custom flag' do - expect(template.instance_variable_get('@custom')).to be_true + expect(template.instance_variable_get('@custom')).to eq true end end end describe '#options' do @@ -41,16 +41,16 @@ it 'should build complete options' do options = template.send(:options) # check default template options - expect(options[:default]).to be_true + expect(options[:default]).to eq true # check template options - expect(options[:template]).to be_true + expect(options[:template]).to eq true # check custom config options - expect(options[:custom]).to be_true + expect(options[:custom]).to eq true # check project specific options expect(options[:type]).to eq('foo_template') expect(options[:project_name]).to eq('new_template') end