【发布时间】:2011-07-26 23:19:31
【问题描述】:
#rspec test code
@room = FactoryGirl.build(:room)
#factory definition
factory :room do
length {10}
width {20}
end
#code implementation
class Room
attr_accessor :length, :width
def initialize(length,width)
@length = length
@width = width
end
end
在尝试构建 @room 时运行 rspec 会导致此错误
参数错误: 参数数量错误(0 代表 2)
【问题讨论】:
标签: ruby factory-bot