2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-03 10:49:58 +02:00
|
|
|
shared_examples "a command that handles invalid options" do
|
|
|
|
context "when an invalid option is specified" do
|
|
|
|
it "raises an exception when no Cask is specified" do
|
|
|
|
expect {
|
|
|
|
described_class.run("--not-a-valid-option")
|
|
|
|
}.to raise_error("invalid option: --not-a-valid-option")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "raises an exception when a Cask is specified" do
|
|
|
|
expect {
|
|
|
|
described_class.run("--not-a-valid-option", "basic-cask")
|
|
|
|
}.to raise_error("invalid option: --not-a-valid-option")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|