2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-28 08:35:36 +00:00
|
|
|
require "cmd/shared_examples/args_parse"
|
|
|
|
|
2021-02-01 16:14:25 -05:00
|
|
|
describe "brew analytics" do
|
2019-03-28 08:35:36 +00:00
|
|
|
it_behaves_like "parseable arguments"
|
|
|
|
|
2021-02-01 16:14:25 -05:00
|
|
|
it "when HOMEBREW_NO_ANALYTICS is unset is disabled after running `brew analytics off`", :integration_test do
|
2017-02-18 17:38:13 +01:00
|
|
|
HOMEBREW_REPOSITORY.cd do
|
2017-07-29 19:55:05 +02:00
|
|
|
system "git", "init"
|
2017-02-18 17:38:13 +01:00
|
|
|
end
|
|
|
|
|
2019-03-28 08:35:36 +00:00
|
|
|
brew "analytics", "off"
|
|
|
|
expect { brew "analytics", "HOMEBREW_NO_ANALYTICS" => nil }
|
2023-06-16 10:33:15 +01:00
|
|
|
.to output(/analytics are disabled/i).to_stdout
|
2017-02-18 17:38:13 +01:00
|
|
|
.and not_to_output.to_stderr
|
|
|
|
.and be_a_success
|
|
|
|
end
|
|
|
|
end
|