lib/knapsack_pro/tracker.rb in knapsack_pro-2.15.0 vs lib/knapsack_pro/tracker.rb in knapsack_pro-2.16.0
- old
+ new
@@ -17,26 +17,31 @@
def reset!
set_defaults
end
def start_timer
+ @start_time ||= now_without_mock_time.to_f
+ end
+
+ def reset_timer
@start_time = now_without_mock_time.to_f
end
def stop_timer
execution_time = @start_time ? now_without_mock_time.to_f - @start_time : 0.0
- if current_test_path
+ if @current_test_path
update_global_time(execution_time)
update_test_file_time(execution_time)
- @current_test_path = nil
+ reset_timer
end
execution_time
end
def current_test_path
- KnapsackPro::TestFileCleaner.clean(@current_test_path) if @current_test_path
+ raise("current_test_path needs to be set by Knapsack Pro Adapter's bind method") unless @current_test_path
+ KnapsackPro::TestFileCleaner.clean(@current_test_path)
end
def set_prerun_tests(test_file_paths)
test_file_paths.each do |test_file_path|
# Set a default time for test file