all repos — markup @ 8abfefe8f2fea12920d2c2380ef2b4041b1633c2

The code we use to render README.your_favorite_markup

test/markup_test.rb (view raw)

 1$LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
 2$LOAD_PATH.unshift File.dirname(__FILE__)
 3
 4require 'github/markup'
 5require 'test/unit'
 6
 7class MarkupTest < Test::Unit::TestCase
 8  Dir['test/markups/README.*'].each do |readme|
 9    next if readme =~ /html$/
10    markup = readme.split('.').last
11
12    define_method "test_#{markup}" do
13      expected = File.read("#{readme}.html")
14      actual = GitHub::Markup.render(readme, File.read(readme))
15      assert_equal expected, actual
16    end
17  end
18end