Class: Dommy::Navigation::NullDelegate
- Inherits:
-
Object
- Object
- Dommy::Navigation::NullDelegate
- Defined in:
- lib/dommy/navigation.rb
Overview
The default delegate: it performs no navigation, only records each attempt so tests can assert "a navigation to X was triggered" and the observable behaviour is unchanged from before the seam existed.
Instance Attribute Summary collapse
-
#attempts ⇒ Object
readonly
Returns the value of attribute attempts.
Instance Method Summary collapse
-
#initialize ⇒ NullDelegate
constructor
A new instance of NullDelegate.
- #navigate(url:, source:, method: "GET", body: nil, params: nil, enctype: nil, headers: {}, replace: false) ⇒ Object
- #traverse(delta) ⇒ Object
Constructor Details
#initialize ⇒ NullDelegate
Returns a new instance of NullDelegate.
46 47 48 |
# File 'lib/dommy/navigation.rb', line 46 def initialize @attempts = [] end |
Instance Attribute Details
#attempts ⇒ Object (readonly)
Returns the value of attribute attempts.
44 45 46 |
# File 'lib/dommy/navigation.rb', line 44 def attempts @attempts end |
Instance Method Details
#navigate(url:, source:, method: "GET", body: nil, params: nil, enctype: nil, headers: {}, replace: false) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/dommy/navigation.rb', line 50 def navigate(url:, source:, method: "GET", body: nil, params: nil, enctype: nil, headers: {}, replace: false) @attempts << { url: url, method: method, body: body, params: params, enctype: enctype, headers: headers, replace: replace, source: source } nil end |
#traverse(delta) ⇒ Object
58 59 60 61 |
# File 'lib/dommy/navigation.rb', line 58 def traverse(delta) @attempts << {traverse: delta, source: :traverse} nil end |