Skip to content

Fix: Load rspec/core in Regular Mode when using RSpec split by test examples feature#181

Merged
ArturT merged 2 commits intomasterfrom
fix-rspec-split-by-examples-regular-mode
Nov 21, 2022
Merged

Fix: Load rspec/core in Regular Mode when using RSpec split by test examples feature#181
ArturT merged 2 commits intomasterfrom
fix-rspec-split-by-examples-regular-mode

Conversation

@ArturT
Copy link
Copy Markdown
Member

@ArturT ArturT commented Nov 21, 2022

problem

When you run Knapsack Pro for RSpec in Regular Mode, and you enable RSpec split by test examples feature, and you forget to set RAILS_ENV=test thenRSpec::Core::Parser is not loaded.

... other envs
export KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=true
bundle exec rake "knapsack_pro:rspec[--format d]"

It crashes with:

rake aborted!
NameError: uninitialized constant RSpec::Core::Parser

        ::RSpec::Core::Parser.parse(cli_args)

reported issue

#180

solution

Require rspec/core when running in Regular Mode. Thanks to that you don't need to remember to explicitly set RAILS_ENV=test.

It's easier to try Knapsack Pro in development (locally).

@ArturT ArturT added the bug label Nov 21, 2022
@ArturT ArturT changed the title Fix: Load rspec/core in Regular Mode when using RSpec split by test examples feature Fix: Load rspec/core in Regular Mode when using RSpec split by test examples feature Nov 21, 2022
@ArturT ArturT requested a review from shadre November 21, 2022 15:46
@ArturT ArturT merged commit 1d4abc6 into master Nov 21, 2022
@ArturT ArturT deleted the fix-rspec-split-by-examples-regular-mode branch November 21, 2022 16:19
Copy link
Copy Markdown
Member

@shadre shadre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants