1
我正在使用Benedikt Diecke的自定义rspec示例组的帖子来测试活动模型串行器,但无法将此转换为使用摩卡而不是rspec mocks。将Rspec模拟转换为Mocha以测试活动模型串行器
http://benediktdeicke.com/2013/01/custom-rspec-example-groups/
的例子包括通用的方法来模拟将被序列化的模型类,它使用RSpec的嘲弄 - 我该如何将它转换为使用摩卡?
let(:resource) do
double(resource_name, attributes).tap do |double|
double.stub(:read_attribute_for_serialization) { |name| attributes[name] }
end
end