Convert brew pin and brew unpin test to spec.
This commit is contained in:
parent
c7121f6be5
commit
73be5ed950
13
Library/Homebrew/test/cmd/pin_spec.rb
Normal file
13
Library/Homebrew/test/cmd/pin_spec.rb
Normal file
@ -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
|
||||||
14
Library/Homebrew/test/cmd/unpin_spec.rb
Normal file
14
Library/Homebrew/test/cmd/unpin_spec.rb
Normal file
@ -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
|
||||||
@ -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
|
|
||||||
Loading…
x
Reference in New Issue
Block a user