Class: RSpec::Risky::UnknownTestConfig

Inherits:
RuleConfig
  • Object
show all
Defined in:
lib/rspec/risky/configuration.rb,
sig/rspec/risky.rbs

Constant Summary

Constants inherited from RuleConfig

RuleConfig::VALID_SEVERITIES

Instance Attribute Summary collapse

Attributes inherited from RuleConfig

#severity

Instance Method Summary collapse

Constructor Details

#initializeUnknownTestConfig

Returns a new instance of UnknownTestConfig.



55
56
57
58
59
# File 'lib/rspec/risky/configuration.rb', line 55

def initialize
  super
  @adapters = []
  @count_mocks = true
end

Instance Attribute Details

#adaptersArray[untyped]

Returns the value of attribute adapters.

Returns:

  • (Array[untyped])


53
54
55
# File 'lib/rspec/risky/configuration.rb', line 53

def adapters
  @adapters
end

#count_mocksBoolean

Returns the value of attribute count_mocks.

Returns:

  • (Boolean)


53
54
55
# File 'lib/rspec/risky/configuration.rb', line 53

def count_mocks
  @count_mocks
end

Instance Method Details

#adapter_count(example) ⇒ Integer

Parameters:

  • example (Object)

Returns:

  • (Integer)


61
62
63
64
65
66
67
# File 'lib/rspec/risky/configuration.rb', line 61

def adapter_count(example)
  adapters.sum do |adapter|
    Integer(adapter.call(example))
  rescue StandardError
    0
  end
end