Sha256: 01470b189759e516a95cdcc7b81172d8b1de0d86e9a42d8895872f206e10de58

Contents?: true

Size: 820 Bytes

Versions: 63

Compression:

Stored size: 820 Bytes

Contents

#!/usr/bin/env ruby
require 'lib/redcloth'
require 'yaml'

Dir["tests/*.yml"].each do |testfile|
    YAML::load_documents( File.open( testfile ) ) do |doc|
        if doc['in'] and doc['out']
            opts = []
            opts << :hard_breaks if testfile =~ /hard_breaks/
            red = RedCloth.new( doc['in'], opts )
            html = if testfile =~ /markdown/
                       red.to_html( :markdown )
                   else
                       red.to_html
                   end
            puts "---"

            html.gsub!( /\n+/, "\n" )
            doc['out'].gsub!( /\n+/, "\n" )
            if html == doc['out']
                puts "success: true"
            else
                puts "out: "; p html
                puts "expected: "; p doc['out']
            end
        end
    end
end

Version data entries

63 entries across 63 versions & 7 rubygems

Version Path
gsterndale-warrant-0.2.0 test/rails_root/vendor/gems/RedCloth-3.0.4/run-tests.rb
radiant-1.0.0.rc2 vendor/redcloth/run-tests.rb
radiant-1.0.0.rc1 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.2.4 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.2.2 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.2.1 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.2 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.9 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.8 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.7 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.6 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.5 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.4 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.3 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.2 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1.1 vendor/redcloth/run-tests.rb
radiantcms-couchrest_model-0.1 vendor/redcloth/run-tests.rb
radiant-0.7.2 vendor/redcloth/run-tests.rb
radiant-0.9.1 vendor/redcloth/run-tests.rb
radiant-0.8.2 vendor/redcloth/run-tests.rb