# module ActiveSupport::Testing::Performance::ForMiniTest

### Public Instance Methods

run(runner) click to toggle source

    # File lib/active_support/testing/performance.rb, line 45
    def run(runner)
      @runner = runner

      run_warmup
      if full_profile_options && metrics = full_profile_options[:metrics]
        metrics.each do |metric_name|
          if klass = Metrics[metric_name.to_sym]
            run_profile(klass.new)
          end
        end
      end

      return
    end

run_test(metric, mode) click to toggle source

    # File lib/active_support/testing/performance.rb, line 60
    def run_test(metric, mode)
      result = '.'
      begin
        run_callbacks :setup
        setup
        metric.send(mode) { __send__ method_name }
      rescue Exception => e
        result = @runner.puke(self.class, method_name, e)
      ensure
        begin
          teardown
          run_callbacks :teardown, :enumerator => :reverse_each
        rescue Exception => e
          result = @runner.puke(self.class, method_name, e)
        end
      end
      result
    end