Class: ViewMatchers::Form
- Inherits:
-
Object
- Object
- ViewMatchers::Form
- Defined in:
- lib/view_matchers/form_matcher/form.rb
Instance Attribute Summary collapse
-
#failures ⇒ Object
readonly
Returns the value of attribute failures.
Instance Method Summary collapse
- #exists_in_rendered?(actual_form) ⇒ Boolean
-
#initialize(block) ⇒ Form
constructor
A new instance of Form.
Constructor Details
#initialize(block) ⇒ Form
Returns a new instance of Form.
5 6 7 8 |
# File 'lib/view_matchers/form_matcher/form.rb', line 5 def initialize(block) @block = block self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
20 21 22 |
# File 'lib/view_matchers/form_matcher/form.rb', line 20 def method_missing(method, *args, &block) @exists_in_rendered &= matches_selector? method, *args, &block end |
Instance Attribute Details
#failures ⇒ Object (readonly)
Returns the value of attribute failures.
3 4 5 |
# File 'lib/view_matchers/form_matcher/form.rb', line 3 def failures @failures end |
Instance Method Details
#exists_in_rendered?(actual_form) ⇒ Boolean
10 11 12 13 14 15 16 |
# File 'lib/view_matchers/form_matcher/form.rb', line 10 def exists_in_rendered?(actual_form) @failures = {} @current_scope = actual_form @exists_in_rendered = true instance_eval(&@block) @exists_in_rendered end |