# ~*~ encoding: utf-8 ~*~ require File.expand_path( '../helper', __FILE__ ) require File.expand_path( '../wiki_factory', __FILE__ ) context "gitcode" do def page_with_content c index = @wiki.repo.index index.add 'Sample-Html.md', c index.commit 'adding file html sample' page = @wiki.page 'Sample Html' page end setup do # context @wiki, @path, @cleanup = WikiFactory.create 'examples/test.git' # given p = page_with_content "a\n\n```html:github/gollum/master/test/file_view/1_file.txt```\n\nb" # when rendering the page @rendered = Gollum::Markup.new(p).render end test 'that the rendered output is correctly fetched and rendered as html code' do assert_equal %Q{

a

\n\n
<ol class=\"tree\">\n  <li class=\"file\">\n    <a href=\"0\"><span class=\"icon\"></span>0</a>\n  </li>\n</ol>\n
\n\n

b

}, @rendered end test 'contents' do g = Gollum::Gitcode.new 'github/gollum/master/test/file_view/1_file.txt' assert_equal g.contents, %{
    \n
  1. \n 0\n
  2. \n
\n} end teardown do @cleanup.call end end