spec/nanoc/helpers/html_escape_spec.rb in nanoc-4.7.9 vs spec/nanoc/helpers/html_escape_spec.rb in nanoc-4.7.10

- old
+ new

@@ -1,15 +1,17 @@ +# frozen_string_literal: true + describe Nanoc::Helpers::HTMLEscape, helper: true do describe '#html_escape' do subject { helper.html_escape(string) } context 'given strings to escape' do let(:string) { '< > & "' } it { is_expected.to eql('&lt; &gt; &amp; &quot;') } end context 'given a block' do - let!(:_erbout) { 'moo' } + let!(:_erbout) { String.new('moo') } it 'adds escaped content to _erbout' do helper.html_escape { _erbout << '<h1>Stuff!</h1>' } expect(_erbout).to eql('moo&lt;h1&gt;Stuff!&lt;/h1&gt;') end