Class: RSpecTelemetry::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_telemetry/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rspec_telemetry/config.rb', line 18

def initialize
  @enabled = true
  @output_path = self.class.default_output_path
  @capture_examples = true
  @capture_factory_bot = true
  @print_summary = false
  @flush_each = false
  @slow_factory_threshold_ms = nil
  @slow_example_threshold_ms = nil
  @summary_io = $stderr
  @summary_limit = 20
end

Instance Attribute Details

#capture_examplesObject

Returns the value of attribute capture_examples.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def capture_examples
  @capture_examples
end

#capture_factory_botObject

Returns the value of attribute capture_factory_bot.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def capture_factory_bot
  @capture_factory_bot
end

#enabledObject

Returns the value of attribute enabled.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def enabled
  @enabled
end

#flush_eachObject

Returns the value of attribute flush_each.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def flush_each
  @flush_each
end

#output_pathObject

Returns the value of attribute output_path.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def output_path
  @output_path
end

Returns the value of attribute print_summary.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def print_summary
  @print_summary
end

#slow_example_threshold_msObject

Returns the value of attribute slow_example_threshold_ms.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def slow_example_threshold_ms
  @slow_example_threshold_ms
end

#slow_factory_threshold_msObject

Returns the value of attribute slow_factory_threshold_ms.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def slow_factory_threshold_ms
  @slow_factory_threshold_ms
end

#summary_ioObject

Returns the value of attribute summary_io.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def summary_io
  @summary_io
end

#summary_limitObject

Returns the value of attribute summary_limit.



5
6
7
# File 'lib/rspec_telemetry/config.rb', line 5

def summary_limit
  @summary_limit
end

Class Method Details

.default_output_pathObject



31
32
33
34
35
36
37
38
# File 'lib/rspec_telemetry/config.rb', line 31

def self.default_output_path
  suffix = ENV["TEST_ENV_NUMBER"]
  if suffix && !suffix.empty?
    "tmp/rspec_telemetry.#{suffix}.ndjson"
  else
    "tmp/rspec_telemetry.ndjson"
  end
end