Module: Minitest

Defined in:
lib/minitest/test_prof_plugin.rb,
lib/minitest/base_reporter.rb,
lib/minitest/event_prof_formatter.rb,
lib/test_prof/event_prof/minitest.rb,
lib/test_prof/factory_doctor/minitest.rb

Overview

:nodoc:

Defined Under Namespace

Modules: TestProf

Class Method Summary collapse

Class Method Details

.plugin_test_prof_init(options) ⇒ Object



37
38
39
40
41
42
# File 'lib/minitest/test_prof_plugin.rb', line 37

def self.plugin_test_prof_init(options)
  options = TestProf.configure_options(options)

  reporter << TestProf::EventProfReporter.new(options[:io], options) if options[:event]
  reporter << TestProf::FactoryDoctorReporter.new(options[:io], options) if options[:fdoc]
end

.plugin_test_prof_options(opts, options) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/minitest/test_prof_plugin.rb', line 19

def self.plugin_test_prof_options(opts, options)
  opts.on "--event-prof=EVENT", "Collects metrics for specified EVENT" do |event|
    options[:event] = event
  end
  opts.on "--event-prof-rank-by=RANK_BY", "Defines RANK_BY parameter for results" do |rank|
    options[:rank_by] = rank.to_sym
  end
  opts.on "--event-prof-top-count=N", "Limits results with N groups/examples" do |count|
    options[:top_count] = count.to_i
  end
  opts.on "--event-prof-per-example", TrueClass, "Includes examples metrics to results" do |flag|
    options[:per_example] = flag
  end
  opts.on "--factory-doctor", TrueClass, 'Enable Factory Doctor for your examples' do |flag|
    options[:fdoc] = flag
  end
end