require 'spec_helper' require 'turnip_formatter/printer/tab_speed_statistics' module TurnipFormatter::Printer describe TabSpeedStatistics do include_context 'turnip_formatter scenario setup' include_context 'turnip_formatter standard scenario metadata' let :statistics do TurnipFormatter::Printer::TabSpeedStatistics end let :passed_scenarios do ([example] * 3).map do |ex| TurnipFormatter::Scenario::Pass.new(ex) end.each { |s| s.stub(:run_time).and_return(rand) } end describe '.print_out' do it 'should get string as HTML table' do html = statistics.print_out(passed_scenarios) passed_scenarios.each do |scenario| tag_scenario_name = "#{scenario.name}" tag_run_time = "#{scenario.run_time}" tag_feature_name = "#{scenario.feature_name}" expect_match = [ '