ruby - Count of number of test scenarios in my acceptance test suite -
i have added env.rb calculates value after each scenario completion.
say
i = 0 (after scenario 1) = 0.330 (after scenario 2) = 0.330 + 0.3456 = 0.6756 (so on, till end of whole test) now want take average of value number of test scenarios in acceptance suite. make long story short, there method dynamically return number of test case scenarios in whole test suite?
there may be, think there's easier way.
instead of summing, why not append array? give both values , length, can calculate sum , mean (or other average!).
to modify example:
times = [] # (after scenario 1) times << 0.330 # (after scenario 2) times << 0.3456 # (so on, till end of whole test) total_time = times.inject(&:+) num_scenarios = times.length mean_time = total_time / num_scenarios
Comments
Post a Comment