Class: RuleValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/rast/rule_validator.rb

Overview

Validates rules

Instance Method Summary collapse

Instance Method Details

#validate(scenario: [], fixture: {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rast/rule_validator.rb', line 7

def validate(scenario: [], fixture: {})
  spec = fixture[:spec]
  rule_processor = RuleProcessor.new(
    rule: spec.rule,
    token_converters: spec.token_converter
  )

  rule_result = rule_processor.evaluate(scenario: scenario)

  spec = fixture[:spec]
  validate_results(scenario, rule_result, spec)
end