提交 f866f66b 编写于 作者: A Aaron Patterson

expire will set in_use to false

上级 79306de7
......@@ -69,6 +69,7 @@ def initialize(connection, logger = nil) #:nodoc:
@visitor = nil
@schema_cache = SchemaCache.new self
@in_use = false
@last_use = false
end
def lease
......@@ -80,6 +81,10 @@ def lease
end
end
def expire
@in_use = false
end
# Returns the human-readable name of the adapter. Use mixed case - one
# can always use downcase if needed.
def adapter_name
......
......@@ -26,6 +26,13 @@ def test_last_use
adapter.lease
assert adapter.last_use
end
def test_expire_mutates_in_use
assert adapter.lease, 'lease adapter'
assert adapter.in_use?, 'adapter is in use'
adapter.expire
assert !adapter.in_use?, 'adapter is in use'
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册