-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from jacebrowning/handle-unspecified-browser
Handle unspecified browser
- Loading branch information
Showing
7 changed files
with
56 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# pylint: disable=unused-variable,expression-not-assigned | ||
|
||
from pomace import browser | ||
from pomace.config import settings | ||
|
||
|
||
def describe_launch(): | ||
def it_requires_a_browser_to_be_set(expect): | ||
settings.browser.name = "" | ||
with expect.raises(SystemExit): | ||
browser.launch() | ||
|
||
def it_rejects_invalid_browsers(expect): | ||
settings.browser.name = "foobar" | ||
with expect.raises(SystemExit): | ||
browser.launch() | ||
|
||
def it_forces_lowercase_browser_name(expect, mocker): | ||
settings.browser.name = "Firefox" | ||
mocker.patch.object(browser, "Browser") | ||
browser.launch() | ||
expect(settings.browser.name) == "firefox" | ||
|
||
def it_handles_unspecified_browser(expect, mocker): | ||
settings.browser.name = "open" | ||
mocker.patch.object(browser, "Browser") | ||
browser.launch() | ||
expect(settings.browser.name) == "firefox" |
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 was deleted.
Oops, something went wrong.