module CucumberFM::FeatureElement::Component::TotalEstimation

Public Instance Methods

estimation() click to toggle source
# File lib/cucumber_f_m/feature_element/component/total_estimation.rb, line 5
def estimation
  scenarios.inject(0.0) { |sum, scenario| sum + scenario.estimation }
end
estimation_done() click to toggle source
# File lib/cucumber_f_m/feature_element/component/total_estimation.rb, line 9
def estimation_done
  scenarios.inject(0.0) do |sum, scenario|
    estimation_done_filter.pass?(scenario.tags) ?
            sum + scenario.estimation :
            sum
  end
end
estimation_done_percentage() click to toggle source
# File lib/cucumber_f_m/feature_element/component/total_estimation.rb, line 17
def estimation_done_percentage
  estimation > 0 ? ( estimation_done.to_f / estimation * 100 ).round : 0 
end
scenarios_done() click to toggle source
# File lib/cucumber_f_m/feature_element/component/total_estimation.rb, line 21
def scenarios_done
  scenarios.inject(0) do |sum, scenario|
    estimation_done_filter.pass?(scenario.tags) ?
            sum + 1 :
            sum
  end
end
scenarios_done_percentage() click to toggle source
# File lib/cucumber_f_m/feature_element/component/total_estimation.rb, line 29
def scenarios_done_percentage
  !scenarios.empty? ? ( scenarios_done.to_f / scenarios.size * 100 ).round : 0
end

Private Instance Methods

estimation_done_filter() click to toggle source
# File lib/cucumber_f_m/feature_element/component/total_estimation.rb, line 35
def estimation_done_filter
  tags = CucumberFM::FeatureElement::Component::Tags::STATUS_COMPLETE
  @estimation_done_filter = CucumberFM::TagFilter.new(tags.join(','))
end