Class: TestProf::LetItBe::Configuration
- Inherits:
-
Object
- Object
- TestProf::LetItBe::Configuration
- Defined in:
- lib/test_prof/recipes/rspec/let_it_be.rb
Instance Attribute Summary collapse
-
#report_duplicates ⇒ Object
Returns the value of attribute report_duplicates.
Instance Method Summary collapse
-
#alias_to(name, **default_args) ⇒ Object
Define an alias for ‘let_it_be` with the predefined options:.
- #default_modifiers ⇒ Object
-
#register_modifier(key, on: :let, &block) ⇒ Object
Register modifier by providing the name of key, optional scope (when to apply the modifier, on initialization (:initialize) or when accessed # via let (:let)).
Instance Attribute Details
#report_duplicates ⇒ Object
Returns the value of attribute report_duplicates.
19 20 21 |
# File 'lib/test_prof/recipes/rspec/let_it_be.rb', line 19 def report_duplicates @report_duplicates end |
Instance Method Details
#alias_to(name, **default_args) ⇒ Object
26 27 28 |
# File 'lib/test_prof/recipes/rspec/let_it_be.rb', line 26 def alias_to(name, **default_args) LetItBe.define_let_it_be_alias(name, **default_args) end |
#default_modifiers ⇒ Object
39 40 41 |
# File 'lib/test_prof/recipes/rspec/let_it_be.rb', line 39 def default_modifiers @default_modifiers ||= {} end |
#register_modifier(key, on: :let, &block) ⇒ Object
Register modifier by providing the name of key, optional scope (when to apply the modifier, on initialization (:initialize) or when accessed # via let (:let))
33 34 35 36 37 |
# File 'lib/test_prof/recipes/rspec/let_it_be.rb', line 33 def register_modifier(key, on: :let, &block) raise ArgumentError, "Modifier #{key} is already defined for let_it_be" if LetItBe.modifiers.key?(key) LetItBe.modifiers[key] = Modifier.new(on, block) end |