aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cmd
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-25 06:56:28 +0100
committerGitHub2017-02-25 06:56:28 +0100
commit798e8ec45bb353982829260e4853a9545de58e53 (patch)
tree9f1e4558480e8c4bfa332735abcc9748f4e4e892 /Library/Homebrew/test/cmd
parent7701bfcb1f11687596fc920d3edf274835c09efa (diff)
parentb07f0d1038c4d4af5416a00330e3f4aba0d2056a (diff)
downloadbrew-798e8ec45bb353982829260e4853a9545de58e53.tar.bz2
Merge pull request #2123 from reitermarkus/spec-unlinkapps
Convert `brew unlinkapps` test to spec.
Diffstat (limited to 'Library/Homebrew/test/cmd')
-rw-r--r--Library/Homebrew/test/cmd/unlinkapps_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cmd/unlinkapps_spec.rb b/Library/Homebrew/test/cmd/unlinkapps_spec.rb
new file mode 100644
index 000000000..1e21bd851
--- /dev/null
+++ b/Library/Homebrew/test/cmd/unlinkapps_spec.rb
@@ -0,0 +1,24 @@
+describe "brew unlinkapps", :integration_test do
+ let(:home_dir) { @home_dir = Pathname.new(Dir.mktmpdir) }
+ let(:apps_dir) { home_dir/"Applications" }
+
+ after(:each) do
+ home_dir.rmtree unless @home_dir.nil?
+ end
+
+ it "unlinks symlinked applications" do
+ apps_dir.mkpath
+
+ setup_test_formula "testball"
+
+ source_app = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
+ source_app.mkpath
+
+ FileUtils.ln_s source_app, apps_dir/"TestBall.app"
+
+ expect { brew "unlinkapps", "--local", "HOME" => home_dir }
+ .to output(%r{Unlinking: #{Regexp.escape(apps_dir)}/TestBall.app}).to_stdout
+ .and output(/`brew unlinkapps` has been deprecated/).to_stderr
+ .and be_a_success
+ end
+end