Class: CukeSniffer::RulesEvaluator

Inherits:
Object
  • Object
show all
Includes:
Constants
Defined in:
lib/cuke_sniffer/rules_evaluator.rb

Overview

Author

Robert Cochran ([email protected])

Copyright

Copyright © 2014 Robert Cochran

License

Distributes under the MIT License

Evaluates all cucumber components found in CukeSniffer with the passed rules

Constant Summary

Constants included from Constants

Constants::COMMENT_REGEX, Constants::DATE_REGEX, Constants::DEFAULT_OUTPUT_FILE_NAME, Constants::FILE_IGNORE_LIST, Constants::HOOK_REGEX, Constants::HOOK_STYLES, Constants::MARKUP_SOURCE, Constants::SCENARIO_TITLE_STYLES, Constants::STEP_DEFINITION_REGEX, Constants::STEP_REGEX, Constants::STEP_STYLES, Constants::TAG_REGEX, Constants::THRESHOLDS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli, rules) ⇒ RulesEvaluator

Returns a new instance of RulesEvaluator.



11
12
13
14
15
16
17
18
# File 'lib/cuke_sniffer/rules_evaluator.rb', line 11

def initialize(cli, rules)
  raise "A CLI must be provided for evaluation." if cli.nil?
  raise "Rules must be provided for evaluation." if rules.nil? or rules.empty?
  @rules = rules
  judge_features(cli.features)
  judge_objects(cli.step_definitions, "StepDefinition")
  judge_objects(cli.hooks, "Hook")
end

Instance Attribute Details

#rulesObject

Returns the value of attribute rules.



9
10
11
# File 'lib/cuke_sniffer/rules_evaluator.rb', line 9

def rules
  @rules
end