1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Remove Rails strip_heredoc dependency since Rails is not listed as a add_development_dependency.

This commit is contained in:
Kurt Stephens 2017-03-06 09:45:55 -06:00 committed by James Cox
parent 1ee68103ec
commit 8d87234ded

View file

@ -88,23 +88,23 @@ RSpec.describe 'AwesomePrint' do
it 'wraps multiline ap output with <pre> tag with colorized <kbd>' do it 'wraps multiline ap output with <pre> tag with colorized <kbd>' do
markup = [1, :two, 'three'] markup = [1, :two, 'three']
expect(markup.ai(html: true)).to eq <<-EOS.strip_heredoc.strip expect(markup.ai(html: true)).to eq <<-EOS.strip
<pre>[ <pre>[
<kbd style="color:white">[0] </kbd><kbd style="color:blue">1</kbd>, <kbd style="color:white">[0] </kbd><kbd style="color:blue">1</kbd>,
<kbd style="color:white">[1] </kbd><kbd style="color:darkcyan">:two</kbd>, <kbd style="color:white">[1] </kbd><kbd style="color:darkcyan">:two</kbd>,
<kbd style="color:white">[2] </kbd><kbd style="color:brown">&quot;three&quot;</kbd> <kbd style="color:white">[2] </kbd><kbd style="color:brown">&quot;three&quot;</kbd>
]</pre> ]</pre>
EOS EOS
end end
it 'wraps hash ap output with only an outer <pre> tag' do it 'wraps hash ap output with only an outer <pre> tag' do
markup = [{ 'hello' => 'world' }] markup = [{ 'hello' => 'world' }]
expect(markup.ai(html: true)).to eq <<-EOS.strip_heredoc.strip expect(markup.ai(html: true)).to eq <<-EOS.strip
<pre>[ <pre>[
<kbd style="color:white">[0] </kbd>{ <kbd style="color:white">[0] </kbd>{
&quot;hello&quot;<kbd style="color:slategray"> =&gt; </kbd><kbd style="color:brown">&quot;world&quot;</kbd> &quot;hello&quot;<kbd style="color:slategray"> =&gt; </kbd><kbd style="color:brown">&quot;world&quot;</kbd>
} }
]</pre> ]</pre>
EOS EOS
end end
@ -130,12 +130,12 @@ RSpec.describe 'AwesomePrint' do
AwesomePrint.defaults = { indent: -2, sort_keys: true } AwesomePrint.defaults = { indent: -2, sort_keys: true }
hash = { [0, 0, 255] => :yellow, :red => 'rgb(255, 0, 0)', 'magenta' => 'rgb(255, 0, 255)' } hash = { [0, 0, 255] => :yellow, :red => 'rgb(255, 0, 0)', 'magenta' => 'rgb(255, 0, 255)' }
out = hash.ai(plain: true) out = hash.ai(plain: true)
expect(out).to eq <<-EOS.strip_heredoc.strip expect(out).to eq <<-EOS.strip
{ {
[ 0, 0, 255 ] => :yellow, [ 0, 0, 255 ] => :yellow,
"magenta" => "rgb(255, 0, 255)", "magenta" => "rgb(255, 0, 255)",
:red => "rgb(255, 0, 0)" :red => "rgb(255, 0, 0)"
} }
EOS EOS
end end
end end