diff --git a/.circleci/config.yml b/.circleci/config.yml index 1cf5e39a..af0fab57 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,6 +165,18 @@ jobs: export KNAPSACK_PRO_ENDPOINT=https://api-fake.knapsackpro.com export KNAPSACK_PRO_MAX_REQUEST_RETRIES=1 bundle exec rake knapsack_pro:rspec + - run: + working_directory: ~/rails-app-with-knapsack_pro + command: | + # ensures KnapsackPro::Formatters::TimeTracker works when the .rspec file does not exist + export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--regular--no-dot-rspec-file" + mv .rspec .rspec.off + # load test files that require spec_helper explicitly + export KNAPSACK_PRO_TEST_FILE_PATTERN="{spec/time_tracker_spec.rb}" + bundle exec rake knapsack_pro:rspec + RSPEC_EXIT_CODE=$? + mv .rspec.off .rspec + exit $RSPEC_EXIT_CODE - run: working_directory: ~/rails-app-with-knapsack_pro command: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d2eeef7..3ce0d03b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ### UNRELEASED +### 7.6.2 + +* Fix an error for the `KnapsackPro::Formatters::TimeTracker` formatter in RSpec when using Knapsack Pro Regular Mode and the `.rspec` file is not present. + + https://github.com/KnapsackPro/knapsack_pro-ruby/pull/265 + +https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.6.1...v7.6.2 + ### 7.6.1 * Add support for the Timecop 0.9.9 gem version so that we could track proper tests' execution time when `Process.clock_gettime` is mocked. diff --git a/lib/knapsack_pro/formatters/time_tracker.rb b/lib/knapsack_pro/formatters/time_tracker.rb index c41fa5b5..812a1ab9 100644 --- a/lib/knapsack_pro/formatters/time_tracker.rb +++ b/lib/knapsack_pro/formatters/time_tracker.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'stringio' +require_relative '../utils' module KnapsackPro module Formatters