0
所以我有一个制造商和两个子类的父类。如何让子类引用父类的构造器来设置共享代码?如何烘干分类制造商?
E. G.
Fabricator(:parent) do
important_variable "Foo"
lesser_variable "Bar
end
Fabricator(:child1) do
//Not sure I actually need anything in here
end
Fabricator(:child2) do
//Again, not sure I actually need anything in here
end
Fabricate(:child).important_variable #Foo
Fabricate(:child).lesser_variable #Bar
欢快,我阅读文档。不知何故,错过了这个。 – RonLugge
该文档站点也是开源的,所以如果你认为他们可以改进使PR:) https://github.com/paulelliott/fabrication-site –
那,只是我没有看到什么是正确的前面我 - 应该搜索“继承”而不是“子类”,即使我的大脑不会放弃它,这也是正确的词。 – RonLugge