Module: Canql::Nodes::TestAcceptanceExistence::WithCondition
- Defined in:
- lib/canql/nodes/test_result_group.rb
Instance Method Summary collapse
- #existence_filter ⇒ Object
- #requirement_filter ⇒ Object
- #test_acceptance ⇒ Object
- #test_acceptance_filter ⇒ Object
- #to_test_acceptance ⇒ Object
Instance Method Details
#existence_filter ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/canql/nodes/test_result_group.rb', line 53 def existence_filter { Canql::EQUALS => ['supplied required', 'supplied'].include?( existence_modifier.text_value.strip ) } end |
#requirement_filter ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/canql/nodes/test_result_group.rb', line 61 def requirement_filter { Canql::EQUALS => ['supplied required', 'missing required'].include?( existence_modifier.text_value.strip ) } end |
#test_acceptance ⇒ Object
42 43 44 |
# File 'lib/canql/nodes/test_result_group.rb', line 42 def test_acceptance acceptance.text_value.strip.parameterize.underscore end |
#test_acceptance_filter ⇒ Object
69 70 71 |
# File 'lib/canql/nodes/test_result_group.rb', line 69 def test_acceptance_filter { Canql::EQUALS => test_acceptance } end |
#to_test_acceptance ⇒ Object
46 47 48 49 50 51 |
# File 'lib/canql/nodes/test_result_group.rb', line 46 def to_test_acceptance test_acceptance_hash = { 'exists' => existence_filter } test_acceptance_hash['required'] = requirement_filter test_acceptance_hash['acceptance'] = test_acceptance_filter if test_acceptance.present? test_acceptance_hash end |