Make `UnexpectedNilError` un-rescueable from tests
まだ誰も着手していません。
評価
調査の方向性
まず UnexpectedNilError と not_nil! の実装を見つけ、次にプロジェクトが minitest または RSpec をどのように呼び出しているかを調べます。テストランナーをクラッシュさせずに、単純な rescue => e がこのエラーを隠すのをテストで防ぐ方法を特定します。minitest と RSpec が引き続き実行され、通常のテストコードではエラーを捕捉できない状態が保たれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Ruby
- スター
- 3
- フォーク
- 5
- 平均マージ
- 8日 23時間
- マージ済み PR(30日)
- 8
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Shopify/type_toolkit のほかの issue
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Shopify/type_toolkit#4 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Shopify/type_toolkit#45 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Shopify/type_toolkit#14 ·
-
good first issue
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Shopify/type_toolkit#11 · コメント 3 件 ·
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
Shopify/type_toolkit#10 ·
Shopify/type_toolkit の issue をすべて見る
似ている issue
-
user-reported
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Kong/developer.konghq.com#7316 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
TheOdinProject/curriculum#31408 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
bensheldon/good_job#1816 · コメント 5 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
notch8/utk_knapsack#148 ·