aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAndrea Kao2016-07-26 18:52:24 -0700
committerMartin Afanasjew2016-07-27 03:52:24 +0200
commite9c079e7622363ea013024e952666c6d2da79496 (patch)
treef3087a231bdef1418cfd51c959b5d22255a842f7 /Library
parent0be204aab5878284d8466b141a82d56a166abe7b (diff)
downloadbrew-e9c079e7622363ea013024e952666c6d2da79496.tar.bz2
tests: add cmd/analytics integration test (#558)
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index 166cd3fc9..927c10552 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -737,4 +737,23 @@ class IntegrationCommandTests < Homebrew::TestCase
assert_match "Patch failed to apply",
cmd_fail("pull", "https://github.com/Homebrew/homebrew-core/pull/1")
end
+
+ def test_analytics
+ HOMEBREW_REPOSITORY.cd do
+ shutup do
+ system "git", "init"
+ end
+ end
+
+ assert_match "Invalid usage", cmd_fail("analytics", "on", "off")
+ assert_match "Invalid usage", cmd_fail("analytics", "testball")
+ assert_match "Analytics is enabled", cmd("analytics")
+ assert_match "Analytics is disabled",
+ cmd("analytics", "HOMEBREW_NO_ANALYTICS" => "1")
+
+ cmd("analytics", "regenerate-uuid")
+ cmd("analytics", "on")
+ cmd("analytics", "off")
+ assert_match "Analytics is disabled", cmd("analytics")
+ end
end