File: benchmark_spec.rb

package info (click to toggle)
ruby-redcloth 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 708 kB
  • sloc: ruby: 1,233; ansic: 201; makefile: 25
file content (15 lines) | stat: -rw-r--r-- 550 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require File.dirname(__FILE__) + '/spec_helper'

describe "Benchmarking", :type => :formatter do
  version = RedCloth::VERSION.is_a?(Module) ? RedCloth::VERSION::STRING : RedCloth::VERSION
  platform = RedCloth.const_defined?(:EXTENSION_LANGUAGE) ? RedCloth::EXTENSION_LANGUAGE : (version < "4.0.0" ? "ruby-regex" : "C")
  
  it "should not be too slow" do
    # puts "Benchmarking version #{version} compiled in #{platform}..."
    fixtures.each do |name, doc|
      if doc['html']
        RedCloth.new(doc['in']).to_html
      end
    end
  end
end