aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-23 06:06:11 +0100
committerMarkus Reiter2017-02-23 20:59:40 +0100
commitb07f0d1038c4d4af5416a00330e3f4aba0d2056a (patch)
treecab622ed5912f81832cc500ae903a83cbe5f7f73 /Library
parentc7121f6be50e44784e3e29114617c29715bd9c0f (diff)
downloadbrew-b07f0d1038c4d4af5416a00330e3f4aba0d2056a.tar.bz2
Convert `brew unlinkapps` test to spec.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/cmd/unlinkapps_spec.rb24
-rw-r--r--Library/Homebrew/test/unlinkapps_test.rb19
2 files changed, 24 insertions, 19 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
diff --git a/Library/Homebrew/test/unlinkapps_test.rb b/Library/Homebrew/test/unlinkapps_test.rb
deleted file mode 100644
index 9d9672199..000000000
--- a/Library/Homebrew/test/unlinkapps_test.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestUnlinkapps < IntegrationCommandTestCase
- def test_unlinkapps
- home_dir = Pathname.new(mktmpdir)
- apps_dir = home_dir/"Applications"
- 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"
-
- assert_match "Unlinking: #{apps_dir}/TestBall.app",
- cmd("unlinkapps", "--local", "HOME" => home_dir)
- end
-end