ink 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ink/helper.rb +2 -2
- data/lib/ink/version.rb +1 -1
- data/test/ink/helper_test.rb +7 -0
- metadata +2 -2
data/lib/ink/helper.rb
CHANGED
@@ -13,8 +13,8 @@ module Ink
|
|
13
13
|
# <%= format @code, "Rakefile" %>
|
14
14
|
# <%= format @code, "Rakefile", :line_numbers => true %>
|
15
15
|
#
|
16
|
-
def format(code, file, options = {})
|
17
|
-
Ink::Formatter.format(code, file, options)
|
16
|
+
def format(code, file, options = {}, &block)
|
17
|
+
Ink::Formatter.format(code, file, options, &block)
|
18
18
|
end
|
19
19
|
|
20
20
|
# Return a code snippet highlighted in the specified
|
data/lib/ink/version.rb
CHANGED
data/test/ink/helper_test.rb
CHANGED
@@ -30,4 +30,11 @@ class Ink::HelperTest < Test::Unit::TestCase
|
|
30
30
|
assert_match %r{<td class="line">1</td>}, html
|
31
31
|
assert_match %r{<td class="code">(.*?)</td>}, html
|
32
32
|
end
|
33
|
+
|
34
|
+
def test_format_with_block
|
35
|
+
@helper.format(%[Object.new], "file.rb") do |type, html|
|
36
|
+
assert_equal :code, type
|
37
|
+
assert_match %r{<pre>(.*?)</pre>}, html
|
38
|
+
end
|
39
|
+
end
|
33
40
|
end
|