Class: FactoryBot::Linter
- Inherits:
-
Object
- Object
- FactoryBot::Linter
- Defined in:
- lib/factory_bot/linter.rb
Defined Under Namespace
Classes: FactoryError, FactoryTraitError
Instance Method Summary collapse
-
#initialize(factories, strategy: :create, traits: false, verbose: false) ⇒ Linter
constructor
A new instance of Linter.
- #lint! ⇒ Object
Constructor Details
#initialize(factories, strategy: :create, traits: false, verbose: false) ⇒ Linter
Returns a new instance of Linter.
3 4 5 6 7 8 9 |
# File 'lib/factory_bot/linter.rb', line 3 def initialize(factories, strategy: :create, traits: false, verbose: false) @factories_to_lint = factories @factory_strategy = strategy @traits = traits @verbose = verbose @invalid_factories = calculate_invalid_factories end |
Instance Method Details
#lint! ⇒ Object
11 12 13 14 15 |
# File 'lib/factory_bot/linter.rb', line 11 def lint! if invalid_factories.any? raise InvalidFactoryError, end end |