spec/rake/funnel/support/template_engine_spec.rb in rake-funnel-0.18.0 vs spec/rake/funnel/support/template_engine_spec.rb in rake-funnel-0.19.0

- old
+ new

@@ -14,21 +14,25 @@ it 'should support ruby' do expect(described_class.render('<%= 42 %>')).to eq('42') end it 'should omit newlines for pure ruby lines' do + # rubocop:disable Style/IndentHeredoc template = <<-EOF <%= 42 %> EOF + # rubocop:enable Style/IndentHeredoc expect(described_class.render(template)).to eq('42') end it 'should not omit newlines for mixed ruby lines' do + # rubocop:disable Style/IndentHeredoc template = <<-EOF 12 <%= 34 %> 56 EOF + # rubocop:enable Style/IndentHeredoc expect(described_class.render(template)).to eq("12 34 56\n") end it 'should support @ instead of <%= %>' do @@ -36,12 +40,11 @@ end describe 'binding' do context 'without binding' do it 'should not support contextual variables' do - var = 42 - template = '<%= var %>' + template = '<%= undefined_variable %>' expect { described_class.render(template) }.to raise_error(NameError) end end @@ -58,8 +61,8 @@ end end it 'should report errors with file name' do expect { described_class.render('<%= undefined %>', 'file.template') } - .to raise_error { |ex| expect(ex.backtrace.join("\n")).to match(/file\.template/) } + .to(raise_error { |ex| expect(ex.backtrace.join("\n")).to match(/file\.template/) }) end end