Module: CucumberFM::FeatureElement::Component::TotalEstimation

Included in:
Aggregator::Collection, Aggregator::ScenarioCollection, CucumberFM::Feature, CucumberFeatureManager
Defined in:
lib/cucumber_f_m/feature_element/component/total_estimation.rb

Instance Method Summary collapse

Instance Method Details

#estimationObject



5
6
7
# 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_doneObject



9
10
11
12
13
14
15
# 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_percentageObject



17
18
19
# 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_doneObject



21
22
23
24
25
26
27
# 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_percentageObject



29
30
31
# 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