cask info: display auto_updates
This commit is contained in:
parent
b7e849799f
commit
6d1f99fa5f
@ -18,7 +18,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.info(cask)
|
def self.info(cask)
|
||||||
puts "#{cask.token}: #{cask.version}"
|
title_info(cask)
|
||||||
puts Formatter.url(cask.homepage) if cask.homepage
|
puts Formatter.url(cask.homepage) if cask.homepage
|
||||||
installation_info(cask)
|
installation_info(cask)
|
||||||
repo_info(cask)
|
repo_info(cask)
|
||||||
@ -28,6 +28,12 @@ module Hbc
|
|||||||
Installer.print_caveats(cask)
|
Installer.print_caveats(cask)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.title_info(cask)
|
||||||
|
title = "#{cask.token}: #{cask.version}"
|
||||||
|
title += " (auto_updates)" if cask.auto_updates
|
||||||
|
puts title
|
||||||
|
end
|
||||||
|
|
||||||
def self.formatted_url(url)
|
def self.formatted_url(url)
|
||||||
"#{Tty.underline}#{url}#{Tty.reset}"
|
"#{Tty.underline}#{url}#{Tty.reset}"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -20,6 +20,21 @@ describe Hbc::CLI::Info, :cask do
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "it prints auto_updates if the Cask has `auto_updates true`" do
|
||||||
|
expect {
|
||||||
|
described_class.run("with-auto-updates")
|
||||||
|
}.to output(<<~EOS).to_stdout
|
||||||
|
with-auto-updates: 1.0 (auto_updates)
|
||||||
|
http://example.com/autoupdates
|
||||||
|
Not installed
|
||||||
|
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/with-auto-updates.rb
|
||||||
|
==> Name
|
||||||
|
AutoUpdates
|
||||||
|
==> Artifacts
|
||||||
|
AutoUpdates.app (App)
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
describe "given multiple Casks" do
|
describe "given multiple Casks" do
|
||||||
let(:expected_output) {
|
let(:expected_output) {
|
||||||
<<~EOS
|
<<~EOS
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
cask 'with-auto-updates' do
|
||||||
|
version '1.0'
|
||||||
|
sha256 'e5be907a51cd0d5b128532284afe1c913608c584936a5e55d94c75a9f48c4322'
|
||||||
|
|
||||||
|
url "https://example.com/autoupdates_#{version}.zip"
|
||||||
|
name 'AutoUpdates'
|
||||||
|
homepage 'http://example.com/autoupdates'
|
||||||
|
|
||||||
|
auto_updates true
|
||||||
|
|
||||||
|
app 'AutoUpdates.app'
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user