Knapsack Pro

Check out the new docs for the updated documentation.

FAQ / knapsack_pro / General questions for knapsack_pro gem

What is the order of RSpec hooks in the Queue Mode?

Since version 7.0, Knapsack Pro invokes RSpec hooks in the order you would expect:

before :suite
before :context
before :example
after  :example
after  :context
after  :suite

Learn more about Knapsack Pro hooks in the docs.

For Knapsack Pro versions older than 7.0, keep reading.

By default, RSpec runs before and after hooks, and they are called in the following order:

before :suite
before :context
before :example
after  :example
after  :context
after  :suite

In Queue Mode the knapsack_pro gem fetches a batch of test files from the Queue API and repeats that until no more tests are returned from the Queue API. For each batch of tests fetched, the above hooks are called. This means the before(:suite) and after(:suite) can be called multiple times for a given CI node.

# General questions for knapsack_pro gem
See questions outside of this category

Start using Knapsack Pro

Sign up and speed up your tests.

Get started free