Exception: Spinach::HookNotYieldException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/spinach/exceptions.rb

Overview

This class represents the exception raised when Spinach detects that the around_scenario hook does not yield.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hook) ⇒ HookNotYieldException

Returns a new instance of HookNotYieldException.

Parameters:

  • hook (String)

    The hook which did not yield



59
60
61
# File 'lib/spinach/exceptions.rb', line 59

def initialize(hook)
  @hook = hook
end

Instance Attribute Details

#hookObject (readonly)

Returns the value of attribute hook.



53
54
55
# File 'lib/spinach/exceptions.rb', line 53

def hook
  @hook
end

Instance Method Details

#messageString

Returns A custom message when a hook did not yield.

Returns:

  • (String)

    A custom message when a hook did not yield.



67
68
69
# File 'lib/spinach/exceptions.rb', line 67

def message
  "#{@hook} hooks *must* yield"
end