aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-25 06:52:51 +0100
committerGitHub2017-02-25 06:52:51 +0100
commitddbb2f9378b41d30716fb314e542e20f5392765b (patch)
tree2b2fb80a7b82f80438dcef43e25ec192f4729b4b /Library
parent245050e78fe512e96b95bddf7f5619c1c3572539 (diff)
parent73be5ed950f13715f5a2168875f9cc63ea051627 (diff)
downloadbrew-ddbb2f9378b41d30716fb314e542e20f5392765b.tar.bz2
Merge pull request #2117 from reitermarkus/spec-pin_unpin
Convert `brew pin` and `brew unpin` test to spec.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/cmd/pin_spec.rb13
-rw-r--r--Library/Homebrew/test/cmd/unpin_spec.rb14
-rw-r--r--Library/Homebrew/test/pin_unpin_test.rb18
3 files changed, 27 insertions, 18 deletions
diff --git a/Library/Homebrew/test/cmd/pin_spec.rb b/Library/Homebrew/test/cmd/pin_spec.rb
new file mode 100644
index 000000000..9ffc052c3
--- /dev/null
+++ b/Library/Homebrew/test/cmd/pin_spec.rb
@@ -0,0 +1,13 @@
+describe "brew pin", :integration_test do
+ it "pins a Formula's version" do
+ setup_test_formula "testball"
+ (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
+
+ shutup do
+ expect { brew "pin", "testball" }.to be_a_success
+ expect { brew "upgrade" }.to be_a_success
+ end
+
+ expect(HOMEBREW_CELLAR/"testball/0.1").not_to be_a_directory
+ end
+end
diff --git a/Library/Homebrew/test/cmd/unpin_spec.rb b/Library/Homebrew/test/cmd/unpin_spec.rb
new file mode 100644
index 000000000..4f14626d8
--- /dev/null
+++ b/Library/Homebrew/test/cmd/unpin_spec.rb
@@ -0,0 +1,14 @@
+describe "brew unpin", :integration_test do
+ it "unpins a Formula's version" do
+ setup_test_formula "testball"
+ (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
+
+ shutup do
+ expect { brew "pin", "testball" }.to be_a_success
+ expect { brew "unpin", "testball" }.to be_a_success
+ expect { brew "upgrade" }.to be_a_success
+ end
+
+ expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory
+ end
+end
diff --git a/Library/Homebrew/test/pin_unpin_test.rb b/Library/Homebrew/test/pin_unpin_test.rb
deleted file mode 100644
index 65fb9e4da..000000000
--- a/Library/Homebrew/test/pin_unpin_test.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestPinUnpin < IntegrationCommandTestCase
- def test_pin_unpin
- setup_test_formula "testball"
- (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
-
- cmd("pin", "testball")
- cmd("upgrade")
- refute((HOMEBREW_CELLAR/"testball/0.1").directory?,
- "The latest version directory should NOT be created")
-
- cmd("unpin", "testball")
- cmd("upgrade")
- assert((HOMEBREW_CELLAR/"testball/0.1").directory?,
- "The latest version directory should be created")
- end
-end