Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaigno committed Oct 21, 2015
1 parent 7828272 commit 769fa63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lib/github/markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def command(command, regexp, name, &block)
end

def can_render?(filename)
!!renderer(filename)
content = File.read(filename)
!!renderer(filename, content)
end

def renderer(filename, content)
Expand Down
18 changes: 9 additions & 9 deletions test/markup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ def test_knows_what_it_can_and_cannot_render
end

def test_each_render_has_a_name
assert_equal "markdown", GitHub::Markup.renderer('README.md').name
assert_equal "redcloth", GitHub::Markup.renderer('README.textile').name
assert_equal "rdoc", GitHub::Markup.renderer('README.rdoc').name
assert_equal "org-ruby", GitHub::Markup.renderer('README.org').name
assert_equal "creole", GitHub::Markup.renderer('README.creole').name
assert_equal "wikicloth", GitHub::Markup.renderer('README.wiki').name
assert_equal "asciidoctor", GitHub::Markup.renderer('README.adoc').name
assert_equal "restructuredtext", GitHub::Markup.renderer('README.rst').name
assert_equal "pod", GitHub::Markup.renderer('README.pod').name
assert_equal "markdown", GitHub::Markup.renderer('README.md', '').name
assert_equal "redcloth", GitHub::Markup.renderer('README.textile', '').name
assert_equal "rdoc", GitHub::Markup.renderer('README.rdoc', '').name
assert_equal "org-ruby", GitHub::Markup.renderer('README.org', '').name
assert_equal "creole", GitHub::Markup.renderer('README.creole', '').name
assert_equal "wikicloth", GitHub::Markup.renderer('README.wiki', '').name
assert_equal "asciidoctor", GitHub::Markup.renderer('README.adoc', '').name
assert_equal "restructuredtext", GitHub::Markup.renderer('README.rst', '').name
assert_equal "pod", GitHub::Markup.renderer('README.pod', '').name
end

def test_raises_error_if_command_exits_non_zero
Expand Down

0 comments on commit 769fa63

Please sign in to comment.