diff options
| author | Markus Reiter | 2017-02-08 12:11:04 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-10 17:19:19 +0100 |
| commit | 3ef51dba055700ecca9a4f10e1fe0e714b7f9889 (patch) | |
| tree | d89d0471fdf4882d70ea333cb9645f5a51275da7 /Library/Homebrew/cask/test | |
| parent | dcb206dd1ef1be09f75774c0f86692ad3e31c679 (diff) | |
| download | brew-3ef51dba055700ecca9a4f10e1fe0e714b7f9889.tar.bz2 | |
Convert Edit test to spec.
Diffstat (limited to 'Library/Homebrew/cask/test')
| -rw-r--r-- | Library/Homebrew/cask/test/cask/cli/edit_test.rb | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/Library/Homebrew/cask/test/cask/cli/edit_test.rb b/Library/Homebrew/cask/test/cask/cli/edit_test.rb deleted file mode 100644 index 6eb2289c0..000000000 --- a/Library/Homebrew/cask/test/cask/cli/edit_test.rb +++ /dev/null @@ -1,62 +0,0 @@ -require "test_helper" - -# monkeypatch for testing -module Hbc - class CLI - class Edit - def self.exec_editor(*command) - editor_commands << command - end - - def self.reset! - @editor_commands = [] - end - - def self.editor_commands - @editor_commands ||= [] - end - end - end -end - -describe Hbc::CLI::Edit do - before do - Hbc::CLI::Edit.reset! - end - - it "opens the editor for the specified Cask" do - Hbc::CLI::Edit.run("alfred") - Hbc::CLI::Edit.editor_commands.must_equal [ - [Hbc.path("alfred")], - ] - end - - it "throws away additional arguments and uses the first" do - Hbc::CLI::Edit.run("adium", "alfred") - Hbc::CLI::Edit.editor_commands.must_equal [ - [Hbc.path("adium")], - ] - end - - it "raises an exception when the Cask doesnt exist" do - lambda { - Hbc::CLI::Edit.run("notacask") - }.must_raise Hbc::CaskUnavailableError - end - - describe "when no Cask is specified" do - it "raises an exception" do - lambda { - Hbc::CLI::Edit.run - }.must_raise Hbc::CaskUnspecifiedError - end - end - - describe "when no Cask is specified, but an invalid option" do - it "raises an exception" do - lambda { - Hbc::CLI::Edit.run("--notavalidoption") - }.must_raise Hbc::CaskUnspecifiedError - end - end -end |
