Module: CucumberFM::FeatureElement::Component::Tags

Included in:
Info, Scenario, ScenarioOutline
Defined in:
lib/cucumber_f_m/feature_element/component/tags.rb

Constant Summary collapse

LINE_PATTERN =
/^\s*@\S.*$/
TAG_PATTERN =
/@[^,\s]+/
PATTERN =
{
        :component => /@[a-z]\S{3,}\z/,
        :milestone => /@m\d.?\z/,
        :iteration => /@i\d+\z/,
        :priority => /@p\d+\z/,
        :status => /@_[a-z]\S+\z/,
        :developer => /@[a-z]{2,3}\z/,
        :bucket => /@__[^\s\d]+/,
        :effort => /@\d/,
        :benefit => /@_\d/,
        :something_todo => /@:::[a-z]{2,3}\z/,
        :role => /@\$_[a-z_]+/
}
TECHNICAL =
[
        '@javascript',
        '@selenium',
        '@sellenium',
        '@celerity',
        '@culerity',
        '@mongo',
        '@allow-rescue',
        '@needs_wireframe',
        '@tested_elsewhere',
        '@added',
        '@nontestable',
        '@additional-test'
]
STATUS_COMPLETE =
%w(@_done @_qa @_tested @_accepted)

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object (private)



98
99
100
101
102
103
104
# File 'lib/cucumber_f_m/feature_element/component/tags.rb', line 98

def method_missing(m, *args, &block)
  if PATTERN.has_key?(m.to_sym)
    find(m.to_sym)
  else
    super
  end
end

Instance Method Details

#done?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/cucumber_f_m/feature_element/component/tags.rb', line 51

def done?
  STATUS_COMPLETE.include?(status)
end

#estimationObject



56
57
58
# File 'lib/cucumber_f_m/feature_element/component/tags.rb', line 56

def estimation
  effort ? effort.gsub('@', '').to_f : 0.0
end

#tagsObject



39
40
41
# File 'lib/cucumber_f_m/feature_element/component/tags.rb', line 39

def tags
  @tags ||= fetch_tags
end

#tags=(tags) ⇒ Object



43
44
45
# File 'lib/cucumber_f_m/feature_element/component/tags.rb', line 43

def tags= tags
  @tags = tags
end

#tags_without_technicalObject



47
48
49
# File 'lib/cucumber_f_m/feature_element/component/tags.rb', line 47

def tags_without_technical
  tags - TECHNICAL
end

#valueObject



60
61
62
# File 'lib/cucumber_f_m/feature_element/component/tags.rb', line 60

def value
  benefit ? benefit.gsub('@_', '').to_i : 0
end