Sha256: c45c6eb0e886c631f81001ba2da031822d143bed764153206193321a43b2e302

Contents?: true

Size: 707 Bytes

Versions: 4

Compression:

Stored size: 707 Bytes

Contents

require 'helper'

class BenchKlass < Minitest::Benchmark
  include HtmlParser

  if ENV["BENCH"]

    def setup
      file = File.expand_path("../../../app", __FILE__)
      @file = file + "/views/fake/fake.html.erb"
    end

    def bench_remove_extras
      assert_performance_linear 0.99 do |n|
        n.times do
          remove_extras(@file)
        end
      end
    end

    def bench_id_spike
      assert_performance_linear 0.99 do |n|
        n.times do
          id_spike("#salinger", @file)
        end
      end
    end

    def bench_id_exists?
      assert_performance_linear 0.99 do |n|
        n.times do
          id_exists?("#salinger", @file)
        end
      end
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
old_style-1.4.5 test/performance/bench_html_parser.rb
old_style-1.4.4 test/performance/bench_html_parser.rb
old_style-1.4.3 test/performance/bench_html_parser.rb
old_style-1.4.2 test/performance/bench_html_parser.rb