brew/Library/Homebrew/test/dev-cmd/livecheck_spec.rb

32 lines
900 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
describe "Homebrew.livecheck_args" do
it_behaves_like "parseable arguments"
end
describe "brew livecheck", :integration_test do
it "reports the latest version of a Formula", :needs_network do
content = <<~RUBY
desc "Some test"
homepage "https://github.com/Homebrew/brew"
url "https://brew.sh/test-1.0.0.tgz"
RUBY
setup_test_formula("test", content)
expect { brew "livecheck", "test" }
.to output(/test : /).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
2020-12-19 23:02:42 -05:00
it "gives an error when no arguments are given and there's no watchlist" do
expect { brew "livecheck" }
.to output(/Invalid usage: A watchlist file is required when no arguments are given\./).to_stderr
.and not_to_output.to_stdout
.and be_a_failure
end
end