1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【RxSwift】テストを書こうとしたら「No such module 'RxSwift'」

Posted at

はじめに

RxSwiftで実装した個人アプリにテストを書き始めましたが

普段テストを書かないので、こんな初歩的なところで詰まりました。

スクリーンショット 2022-01-17 16.31.42.png

やったこと

Editor -> Add Target -> Unit Testing Bundle を追加

スクリーンショット 2022-01-14 12.49.40.png

スクリーンショット 2022-01-14 12.52.56.png

テストファイルも追加

スクリーンショット 2022-01-16 16.24.03.png

スクリーンショット 2022-01-16 16.27.11.png

さてテスト書くか、ってところで No such module'RxSwift' と怒られる

スクリーンショット 2022-01-17 16.31.42.png

解決方法

スクリーンショット 2022-01-17 16.32.12.png

target '{$AppName}Tests' do
    inherit! :search_paths
end

が必要だったんですね。

おまけ

inherit!
現在のターゲットに対する継承モードを設定する

Parameters
inheritanceSymbol
設定する継承モード

Available Modes
:complete ターゲットは親からすべての動作を引き継ぎます。
:none 対象は親からどの動作も引き継ぎません。
:search_paths 対象は親の検索パスのみを継承します。

参考記事

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?