Module: EventedSpec::SpecHelper::CoolioHelpers::GroupHelpers

Included in:
GroupMethods
Defined in:
lib/evented-spec/spec_helper/coolio_helpers.rb

Instance Method Summary collapse

Instance Method Details

#coolio_after(scope = :each) { ... } ⇒ Object

Adds after hook that will run inside coolio event loop after example finishes.

Parameters:

  • scope (Symbol) (defaults to: :each)

    for hook (only :each is supported currently)

Yields:

  • hook block

Raises:

  • (ArgumentError)


18
19
20
21
# File 'lib/evented-spec/spec_helper/coolio_helpers.rb', line 18

def coolio_after(scope = :each, &block)
  raise ArgumentError, "coolio_after only supports :each scope" unless :each == scope
  evented_spec_hooks_for(:coolio_after).unshift block
end

#coolio_before(scope = :each) { ... } ⇒ Object

Adds before hook that will run inside coolio event loop before example starts.

Parameters:

  • scope (Symbol) (defaults to: :each)

    for hook (only :each is supported currently)

Yields:

  • hook block

Raises:

  • (ArgumentError)


9
10
11
12
# File 'lib/evented-spec/spec_helper/coolio_helpers.rb', line 9

def coolio_before(scope = :each, &block)
  raise ArgumentError, "coolio_before only supports :each scope" unless :each == scope
  evented_spec_hooks_for(:coolio_before) << block
end