Skip to content

Commit 3cd08f9

Browse files
ArturT3v0k4
andauthored
update(docs): Missing test execution times in Minitest (#231)
* update(docs): Missing test execution times in Minitest * update(troubleshooting ruby): Remove entry: NameError: uninitialized constant MyModule::MyModelName --------- Co-authored-by: Riccardo <[email protected]>
1 parent a30ff3b commit 3cd08f9

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

docusaurus/docs/ruby/troubleshooting.mdx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ pagination_prev: null
55

66
# Ruby Troubleshooting
77

8-
## `NameError: uninitialized constant MyModule::MyModelName`
9-
10-
Try with full namespacing `::SomeModule::MyModule::MyModelName`.
11-
128
## Debug Knapsack Pro on your development environment/machine
139

1410
### Regular Mode
@@ -516,3 +512,25 @@ Please consider:
516512

517513
- [Splitting by test examples](split-by-test-examples.mdx) if you have a bottleneck file that is packed with test examples
518514
- If it's a retry, remember that [`KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true`](reference.md#knapsack_pro_fixed_queue_split-queue-mode) uses a cached split
515+
516+
## Execution times are all 0 seconds in Minitest
517+
518+
When using `minitest-spec-rails`, avoid the [unsupported *outer describe*](https://github.com/metaskills/minitest-spec-rails?tab=readme-ov-file#test-styles). Otherwise, Knapsack Pro won't be able to track the execution time of each test.
519+
520+
```ruby
521+
# ⛔️ Bad
522+
require 'test_helper'
523+
describe User do
524+
end
525+
```
526+
527+
```ruby
528+
# ✅ Good
529+
require 'test_helper'
530+
class UserTest < ActiveSupport::TestCase
531+
let(:user_ken) { User.create!(email: '[email protected]') }
532+
533+
it 'works' do
534+
expect(user_ken).must_be_instance_of User
535+
end
536+
end

0 commit comments

Comments
 (0)