Sha256: d1c9dceadd1ada582854490e4ea485f2673cbcbf6257ffbc84dba9e637529af9

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')
require 'markout/output'
require 'tempfile'

module Markout
  class OutputTest < Test::Unit::TestCase

    def setup
      default_output
    end

    def test_default_initialization
      assert_nothing_raised { default_output }
      assert_not_nil @output.document
      assert_not_nil @output.format
      assert_not_nil @output.formatter
      assert_equal Markout::Html, @output.formatter.class
    end

    def test_export
      tmpfile = Tempfile.new('markout_test.html')
      tmpfile.puts @output.export
      tmpfile.close
      # Hats down to @kubicek for the "let's diff huge chunks of text in tests!" idea!!!
      diff = `diff -u #{File.expand_path(File.dirname(__FILE__))}/fixtures/markdown.html #{tmpfile.path}`
      assert diff.chomp == '', "Fixture HTML does not match Markout output, see diff below:\n" + diff
    end

    private

    def default_output
      @output = Output.new( fixture_file('markdown.txt'), :history => false )
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
karmi-markout-0.1.6 test/markout_output_test.rb
karmi-markout-0.1.7 test/markout_output_test.rb