Make `UnexpectedNilError` un-rescueable from tests
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by locating UnexpectedNilError and the not_nil! implementation, then inspect how the project invokes minitest or RSpec. Determine how tests can prevent a bare rescue => e from hiding this error without crashing the test runner. Done means the error remains unrescueable by ordinary test code while minitest and RSpec continue to run.
Written by the indexing model from the issue text.
Description
It currently inherits from Exception, so that a bare rescue => e doesn't unintentionally rescue it. We've already run into a real-world case where that proved useful, where a fork of the not_nil! implementation made it derive from StandardError, which indeed hid a test failure (only detected because we switched that copy of the code to use Type Toolkit).
To make it truly uncatchable, we can do something like throw Object.new. In a production app, this would crash your Rails app with UncaughtThrowError, so we'd have to limit it to tests. But we also don't want to crash minitest/RSpec, so we'd need to wrap the test runner in a catch call. We would need some kind of secret-ish tag to throw, that only the test runner can catch.
- Dominant language
- Ruby
- Stars
- 3
- Forks
- 5
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/type_toolkit
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Shopify/type_toolkit#4 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Shopify/type_toolkit#45 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Shopify/type_toolkit#14 ·
-
good first issue
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Shopify/type_toolkit#11 · 3 comments ·
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
Shopify/type_toolkit#10 ·
All issues in Shopify/type_toolkit
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100