brew/Library/Homebrew/test/formula_lock_test.rb
Alyssa Ross d7b8420aaa tests: clean up file system for all tests
(No longer just integration tests.)
2017-01-22 11:15:18 +00:00

24 lines
449 B
Ruby

require "testing_env"
require "formula_lock"
class FormulaLockTests < Homebrew::TestCase
def setup
super
@lock = FormulaLock.new("foo")
@lock.lock
end
def teardown
@lock.unlock
super
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