Sha256: 933dc35e7fc96ca448cba8558edbf95f212d5f0510de67e33d5d5ad0f524ea37

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

#!/usr/bin/env ruby

require 'helper'

class TestRestrictions < Test::Unit::TestCase
  
  # security restrictions
  generate_formatter_tests('filtered_html') do |doc|
    RedCloth.new(doc['in'], [:filter_html]).to_html
  end
  generate_formatter_tests('sanitized_html') do |doc|
    RedCloth.new(doc['in'], [:sanitize_html]).to_html
  end
  
  # pba filters (style, class, id)
  generate_formatter_tests('style_filtered_html') do |doc|
    RedCloth.new(doc['in'], [:filter_styles]).to_html
  end
  generate_formatter_tests('class_filtered_html') do |doc|
    RedCloth.new(doc['in'], [:filter_classes]).to_html
  end
  generate_formatter_tests('id_filtered_html') do |doc|
    RedCloth.new(doc['in'], [:filter_ids]).to_html
  end
  
  # hard breaks - has been deprecated and will be removed in a future version
  generate_formatter_tests('html_no_breaks') do |doc|
    red = RedCloth.new(doc['in'])
    red.hard_breaks = false
    red.to_html
  end
  
  generate_formatter_tests('lite_mode_html') do |doc|
    RedCloth.new(doc['in'], [:lite_mode]).to_html
  end
  
  generate_formatter_tests('no_span_caps_html') do |doc|
    RedCloth.new(doc['in'], [:no_span_caps]).to_html
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
RedCloth-4.0.3-x86-mswin32-60 test/test_restrictions.rb
RedCloth-4.0.1-x86-mswin32-60 test/test_restrictions.rb
RedCloth-4.0.2 test/test_restrictions.rb
RedCloth-4.0.3 test/test_restrictions.rb
RedCloth-4.0.0 test/test_restrictions.rb
RedCloth-4.0.1 test/test_restrictions.rb
RedCloth-4.0.0-x86-mswin32-60 test/test_restrictions.rb
RedCloth-4.0.2-x86-mswin32-60 test/test_restrictions.rb
RedCloth-4.1.1-x86-mswin32-60 test/test_restrictions.rb
RedCloth-4.0.4-x86-mswin32-60 test/test_restrictions.rb
RedCloth-4.1.0-x86-mswin32-60 test/test_restrictions.rb
RedCloth-4.0.4 test/test_restrictions.rb
RedCloth-4.1.0 test/test_restrictions.rb
RedCloth-4.1.0-universal-java test/test_restrictions.rb
RedCloth-4.1.1-universal-java test/test_restrictions.rb
RedCloth-4.1.1 test/test_restrictions.rb