Skip to content

Commit

Permalink
Delegate run_test to @harness
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Jun 15, 2008
1 parent 09c70a0 commit f93a6d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activesupport/lib/active_support/testing/performance.rb
Expand Up @@ -83,7 +83,7 @@ def run_profile(metric)
end

class Performer
delegate :profile_options, :full_test_name, :to => :@harness
delegate :run_test, :profile_options, :full_test_name, :to => :@harness

def initialize(harness, metric)
@harness, @metric = harness, metric
Expand All @@ -97,7 +97,7 @@ def report

class Benchmarker < Performer
def run
profile_options[:runs].times { @harness.run_test(@metric, :benchmark) }
profile_options[:runs].times { run_test(@metric, :benchmark) }
@total = @metric.total
end

Expand Down Expand Up @@ -132,7 +132,7 @@ def with_output_file

class Profiler < Performer
def run
@runs.times { @harness.run_test(@metric, :profile) }
profile_options[:runs].times { run_test(@metric, :profile) }
@data = RubyProf.stop
@total = @data.threads.values.sum(0) { |method_infos| method_infos.sort.last.total_time }
end
Expand Down

0 comments on commit f93a6d9

Please sign in to comment.