Module: CukeSniffer::Constants

Included in:
CLI, DeadStepsHelper, Formatter, RuleTarget, RulesEvaluator, SummaryHelper
Defined in:
lib/cuke_sniffer/constants.rb

Overview

Author

Robert Cochran ([email protected])

Copyright

Copyright © 2014 Robert Cochran

License

Distributes under the MIT License

A collection of constants that are used throughout the gem

Constant Summary collapse

FILE_IGNORE_LIST =

:nodoc:

%w(. .. .svn)
DATE_REGEX =

:nodoc:

/(?<date>\d{2}\/\d{2}\/\d{4})/
COMMENT_REGEX =

:nodoc:

/#?\s*/
TAG_REGEX =

:nodoc:

/(^|\s+)(?<tag>@\S*)/
SCENARIO_TITLE_STYLES =

:nodoc:

/^\s*\#*\s*(?<type>Background|Scenario|Scenario Outline|Scenario Template):\s*/
STEP_STYLES =

:nodoc:

/(?<style>Given|When|Then|And|Or|But|Transform|\*)\s*/
STEP_REGEX =

:nodoc:

/^#{COMMENT_REGEX}#{STEP_STYLES}(?<step_string>.*)/
STEP_DEFINITION_REGEX =

:nodoc:

/^#{STEP_STYLES}[(]?\/(?<step>.+)\/[)]?\sdo\s?(\|(?<parameters>.*)\|)?$/
HOOK_STYLES =

:nodoc:

/(?<type>Before|After|AfterConfiguration|at_exit|Around|AfterStep)/
HOOK_REGEX =
/^#{HOOK_STYLES}(\((?<tags>.*)\)\sdo|\s+do)(\s\|(?<parameters>.*)\|)?/
MARKUP_SOURCE =
File.join(File.dirname(__FILE__), 'report')
DEFAULT_OUTPUT_FILE_NAME =
"cuke_sniffer_result"
THRESHOLDS =

hash: Stores scores to compare against for determining if an object is good

  • Key: String of the object name

Project, Feature, Scenario, StepDefinition
  • Value: Integer of the highest acceptable value an object can have

Customizable for a projects level of acceptable score

CukeSniffer::Constants::THRESHOLDS["Project"] = 95000
{
    "Project" => 1000,
    "Feature" => 30,
    "Scenario" => 30,
    "StepDefinition" => 20,
    "Hook" => 20
}