brew/Library/Homebrew/test/cmd/analytics_spec.rb

21 lines
574 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2024-03-29 16:13:34 -07:00
require "cmd/analytics"
require "cmd/shared_examples/args_parse"
2024-03-29 16:13:34 -07:00
RSpec.describe Homebrew::Cmd::Analytics do
it_behaves_like "parseable arguments"
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
brew "analytics", "off"
expect { brew "analytics", "HOMEBREW_NO_ANALYTICS" => nil }
.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