mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
23 lines
478 B
Ruby
23 lines
478 B
Ruby
require 'testing_env'
|
|
require 'formula_lock'
|
|
|
|
class FormulaLockTests < Homebrew::TestCase
|
|
def setup
|
|
@lock = FormulaLock.new("foo")
|
|
@lock.lock
|
|
end
|
|
|
|
def teardown
|
|
@lock.unlock
|
|
FormulaLock::LOCKDIR.children.each(&:unlink)
|
|
end
|
|
|
|
def test_locking_file_with_existing_lock_raises_error
|
|
assert_raises(OperationInProgressError) { FormulaLock.new("foo").lock }
|
|
end
|
|
|
|
def test_locking_existing_lock_suceeds
|
|
assert_nothing_raised { @lock.lock }
|
|
end
|
|
end
|