Skip to content

Commit

Permalink
Fix Rouge tests for Rouge 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Jun 18, 2016
1 parent a8adb03 commit 00462dd
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions test/filters/test_colorize_syntax.rb
Expand Up @@ -406,7 +406,7 @@ def foo
EOS
expected_output = <<EOS
before
<pre><code class=\"language-ruby highlight\"> <span class=\"k\">def</span> <span class=\"nf\">foo</span>
<pre><code class=\"language-ruby\"> <span class=\"k\">def</span> <span class=\"nf\">foo</span>
<span class=\"k\">end</span></code></pre>
after
EOS
Expand All @@ -416,31 +416,4 @@ def foo
assert_equal(expected_output, actual_output)
end
end

def test_rouge_with_css_class
if_have 'rouge', 'nokogiri' do
# Create filter
filter = ::Nanoc::Filters::ColorizeSyntax.new

# Get input and expected output
input = <<EOS
before
<pre><code class="language-ruby">
def foo
end
</code></pre>
after
EOS
expected_output = <<EOS
before
<pre><code class=\"language-ruby my-class\"> <span class=\"k\">def</span> <span class=\"nf\">foo</span>
<span class=\"k\">end</span></code></pre>
after
EOS

# Run filter
actual_output = filter.setup_and_run(input, default_colorizer: :rouge, rouge: { css_class: 'my-class' })
assert_equal(expected_output, actual_output)
end
end
end

0 comments on commit 00462dd

Please sign in to comment.