Individual skill

swift-protocol-di-testing

テスト可能なSwiftコードのためのプロトコルベースの依存性注入——焦点を絞ったプロトコルとSwift Testingを使用してファイルシステム、ネットワーク、外部APIをモックする。

docs/ja-JP/skills/swift-protocol-di-testing/SKILL.md

Read pinned source

Source commit b38be6a7f6350964d59328b52f0624e1d1d552d1

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Network or broad shell
Last checked
Nov 3, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
299,156
Repository last updated
Nov 6, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# プロトコルベースのSwift依存性注入テスト

外部の依存関係(ファイルシステム、ネットワーク、iCloud)を小さく焦点を絞ったプロトコルとして抽象化することで、SwiftコードをテストしやすくするパターンI/Oなしの決定論的テストをサポートする。

## 起動条件

* ファイルシステム、ネットワーク、または外部APIにアクセスするSwiftコードを書く場合
* 実際の障害を起こさずにエラー処理パスをテストする必要がある場合
* 異なる環境(アプリ、テスト、SwiftUIプレビュー)で動作するモジュールを構築する場合
* Swift並行処理(Actor、Sendable)をサポートするテスト可能なアーキテクチャを設計する場合

## コアパターン

### 1. 小さく焦点を絞ったプロトコルを定義する