Class: GobstonesExpectationsHook
- Inherits:
-
Mumukit::Defaults::ExpectationsHook
- Object
- Mumukit::Defaults::ExpectationsHook
- GobstonesExpectationsHook
- Includes:
- StonesSpec::WithTempfile, WithTestParser
- Defined in:
- lib/expectations_hook.rb
Instance Method Summary collapse
Methods included from WithTestParser
Methods included from StonesSpec::WithTempfile
Instance Method Details
#run!(request) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/expectations_hook.rb', line 54 def run!(request) content = request[:content] expectations = request[:expectations] if content.strip.empty? return expectations.map { |exp| {'expectation' => exp, 'result' => false } } end ast = generate_ast! content all_expectations = expectations + (default_expectations_for parse_test request) all_expectations.map { |exp| {'expectation' => exp, 'result' => run_expectation!(exp, ast)} } end |