unit tests
This commit is contained in:
parent
8b860d3f0e
commit
674b540c6f
|
@ -20,7 +20,7 @@ module Jekyll
|
||||||
$2.scan(/(?:\w="[^"]*"|\w=\w|\w)+/) do |opt|
|
$2.scan(/(?:\w="[^"]*"|\w=\w|\w)+/) do |opt|
|
||||||
key, value = opt.split('=')
|
key, value = opt.split('=')
|
||||||
# If a quoted list, convert to array
|
# If a quoted list, convert to array
|
||||||
if value and value.include? "\""
|
if value && value.include?("\"")
|
||||||
value.gsub!(/"/, "")
|
value.gsub!(/"/, "")
|
||||||
value = value.split
|
value = value.split
|
||||||
end
|
end
|
||||||
|
|
|
@ -76,6 +76,12 @@ CONTENT
|
||||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl', ["test", "{% endhighlight %}", "\n"])
|
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl', ["test", "{% endhighlight %}", "\n"])
|
||||||
assert_equal({ :cssclass => 'hl', :linenos => 'table' }, tag.instance_variable_get(:@options))
|
assert_equal({ :cssclass => 'hl', :linenos => 'table' }, tag.instance_variable_get(:@options))
|
||||||
|
|
||||||
|
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl hl_linenos=3', ["test", "{% endhighlight %}", "\n"])
|
||||||
|
assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => '3' }, tag.instance_variable_get(:@options))
|
||||||
|
|
||||||
|
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl ="3 5 6"', ["test", "{% endhighlight %}", "\n"])
|
||||||
|
assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => ['3', '5', '6'] }, tag.instance_variable_get(:@options))
|
||||||
|
|
||||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'Ruby ', ["test", "{% endhighlight %}", "\n"])
|
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'Ruby ', ["test", "{% endhighlight %}", "\n"])
|
||||||
assert_equal "ruby", tag.instance_variable_get(:@lang), "lexers should be case insensitive"
|
assert_equal "ruby", tag.instance_variable_get(:@lang), "lexers should be case insensitive"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue