Class: RunPatternTests

Inherits:
GrammarLinter show all
Defined in:
lib/ruby_grammar_builder/linters/tests.rb

Overview

Runs the unit tests on each pattern

Instance Method Summary collapse

Methods inherited from GrammarLinter

#post_lint

Methods inherited from GrammarPlugin

display_options, options

Instance Method Details

#pre_lint(pattern, _options) ⇒ Boolean

Runs the unit tests on each pattern

Returns:

  • (Boolean)

    the result of the unit tests



12
13
14
15
16
# File 'lib/ruby_grammar_builder/linters/tests.rb', line 12

def pre_lint(pattern, _options)
    return true unless pattern.is_a? PatternBase

    pattern.run_tests
end