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

testing loaded? method and reducing funcalls

上级 87a319cd
......@@ -259,7 +259,7 @@ def data
end
def loaded?
!!@data
@data
end
def save
......
......@@ -22,6 +22,16 @@ def test_new_record?
s = SqlBypass.new :data => 'foo', :session_id => 10
assert s.new_record?, 'this is a new record!'
end
def test_not_loaded?
s = SqlBypass.new({})
assert !s.loaded?, 'it is not loaded'
end
def test_loaded?
s = SqlBypass.new :data => 'hello'
assert s.loaded?, 'it is loaded'
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册