Class: TestProf::LetItBe::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/test_prof/recipes/rspec/let_it_be.rb

Instance Method Summary collapse

Instance Method Details

#alias_to(name, **default_args) ⇒ Object

Define an alias for ‘let_it_be` with the predefined options:

TestProf::LetItBe.configure do |config|
  config.alias_to :let_it_be_reloaded, reload: true
end


16
17
18
# File 'lib/test_prof/recipes/rspec/let_it_be.rb', line 16

def alias_to(name, **default_args)
  LetItBe.define_let_it_be_alias(name, **default_args)
end

#default_modifiersObject



26
27
28
# File 'lib/test_prof/recipes/rspec/let_it_be.rb', line 26

def default_modifiers
  @default_modifiers ||= {}
end

#register_modifier(key, &block) ⇒ Object

Raises:

  • (ArgumentError)


20
21
22
23
24
# File 'lib/test_prof/recipes/rspec/let_it_be.rb', line 20

def register_modifier(key, &block)
  raise ArgumentError, "Modifier #{key} is already defined for let_it_be" if LetItBe.modifiers.key?(key)

  LetItBe.modifiers[key] = block
end