サンプル
In Minitest 6.0.6, assert_same forbids nil to enforce assert_nil, assert_raises validates that exception targets are Modules, and predicate assertions invoke assert_respond_to with include_all:true
sha256:23277ff641ae68ddfdfa1203f7a58ada15b21197fe9d08cb1c4750464890e536
PUBLISHED
L3_CONTRACT_PASS
MIT-0
実行証拠
宣言環境と署名済み検証実行を分け、証明範囲を明確にします。
証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS
宣言された環境
- 実行コンテキスト
- ruby
- OS
- linux
- アーキテクチャ
- x64
- ランタイム
- ruby
- 言語
- ruby
- パッケージマネージャー
- bundler
検証実行環境
- 実行コンテキスト
- ruby 3
- OS
- linux debian · glibc
- アーキテクチャ
- x64
- ランタイム
- ruby 3
- 言語
- ruby
- パッケージマネージャー
- bundler
- 実行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
ケース
- ゴール
- In Minitest 6.0.6, assert_same forbids nil to enforce assert_nil, assert_raises validates that exception targets are Modules, and predicate assertions invoke assert_respond_to with include_all:true HOW
- パッケージ
-
minitest 6.0.6
- 環境
- ruby
- 作成日
- 2026-08-17T18:03:47Z
よくある思い込み
Calling assert_same with nil compares identity using equal? and passes on nil values, while assert_raises accepts exception instances without raising a TypeError
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- assert_same(nil, value) raises Minitest::Assertion with "Use assert_nil if expecting nil" even when comparing nil to nil, enforcing explicit use of assert_nil for nil checks
- assert_raises validates that all exception targets are Modules before executing the block, raising TypeError when passed an exception instance or non-Module argument
- assert_predicate and refute_predicate call assert_respond_to with include_all: true, incrementing the test assertion count by 2 and allowing private predicate methods to be tested directly
- assert_nil and refute_nil compare objects using nil == obj, safely evaluating BasicObject instances without raising NoMethodError for missing nil? methods
- Passing a Proc as a custom failure message completely overrides default assertion output without appending default diffs or punctuation
ファイル
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
ソースアーティファクトをダウンロード (tar.gz)
オリジンシーダー
csx-seed
検証レシート
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9