Rakefile in redcarpet-2.3.0 vs Rakefile in redcarpet-3.0.0
- old
+ new
@@ -10,9 +10,48 @@
# Packaging
require 'bundler/gem_tasks'
# Testing
-load 'tasks/testing.rake'
+require 'rake/testtask'
-# Sundown
-load 'tasks/sundown.rake'
\ No newline at end of file
+Rake::TestTask.new('test:unit') do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/*_test.rb'
+ t.verbose = true
+ t.warning = false
+end
+
+task 'test:unit' => :compile
+
+desc 'Run conformance tests (MARKDOWN_TEST_VER=1.0)'
+task 'test:conformance' => :compile do |t|
+ script = "#{pwd}/bin/redcarpet"
+ test_version = ENV['MARKDOWN_TEST_VER'] || '1.0.3'
+ lib_dir = "#{pwd}/lib"
+
+ chdir("test/MarkdownTest_#{test_version}") do
+ sh "RUBYLIB=#{lib_dir} ./MarkdownTest.pl --script='#{script}' --tidy"
+ end
+end
+
+desc 'Run version 1.0 conformance suite'
+task 'test:conformance:1.0' => :compile do |t|
+ ENV['MARKDOWN_TEST_VER'] = '1.0'
+ Rake::Task['test:conformance'].invoke
+end
+
+desc 'Run 1.0.3 conformance suite'
+task 'test:conformance:1.0.3' => :compile do |t|
+ ENV['MARKDOWN_TEST_VER'] = '1.0.3'
+ Rake::Task['test:conformance'].invoke
+end
+
+desc 'Run unit and conformance tests'
+task :test => %w[test:unit test:conformance]
+
+desc 'Run benchmarks'
+task :benchmark => :compile do |t|
+ $:.unshift 'lib'
+ load 'test/benchmark.rb'
+end