brew/Library/Homebrew/test/cask/cmd/home_spec.rb

28 lines
845 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-10-03 10:49:58 +02:00
require_relative "shared_examples/invalid_option"
2018-09-06 08:29:14 +02:00
describe Cask::Cmd::Home, :cask do
2016-08-18 22:11:42 +03:00
before do
2017-05-19 21:48:21 +02:00
allow(described_class).to receive(:open_url)
2016-08-18 22:11:42 +03:00
end
2017-10-03 10:49:58 +02:00
it_behaves_like "a command that handles invalid options"
2016-08-18 22:11:42 +03:00
it "opens the homepage for the specified Cask" do
expect(described_class).to receive(:open_url).with("https://brew.sh/")
2017-05-19 21:48:21 +02:00
described_class.run("local-caffeine")
2016-08-18 22:11:42 +03:00
end
it "works for multiple Casks" do
expect(described_class).to receive(:open_url).with("https://brew.sh/")
expect(described_class).to receive(:open_url).with("https://brew.sh/")
2017-05-19 21:48:21 +02:00
described_class.run("local-caffeine", "local-transmission")
2016-08-18 22:11:42 +03:00
end
it "opens the project page when no Cask is specified" do
expect(described_class).to receive(:open_url).with("https://brew.sh/")
2017-05-19 21:48:21 +02:00
described_class.run
2016-08-18 22:11:42 +03:00
end
end