更新mongoid場我試圖單元測試下面的代碼: require 'mongoid'
class Seller
include Mongoid::Document
field :updated_at, type: Time
def update_updated_at
updated_at = Time.now
save
end
我如何單元測試如下: def update_config
store = YAML::Store.new('config.yaml')
store.transaction do
store['A'] = 'a'
end
end
這裏是我的開始: def test_yaml_store
mock_store = flexmock('s