-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mock Onigumo.Downloader in CLI tests
Onigumo.Component is a behavior that can be mocked. CLI tests don’t verify behavior of concrete components. Defined a mock for the Downlaoader components so the CLI tests only verifies its call, not its behavior. Defined the expect mock to return the passed working directory to test it’s set properly.
- Loading branch information
Showing
5 changed files
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import Config | ||
|
||
config(:onigumo, :http_client, HTTPoison) | ||
config(:onigumo, :downloader, Onigumo.Downloader) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import Config | ||
|
||
config(:onigumo, :http_client, HTTPoisonMock) | ||
config(:onigumo, :downloader, OnigumoDownloaderMock) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
ExUnit.start() | ||
|
||
Mox.defmock(HTTPoisonMock, for: HTTPoison.Base) | ||
Mox.defmock(OnigumoDownloaderMock, for: Onigumo.Component) |