1
我想让((变量)一个对象,以便我可以在上下文中的不同测试中使用此对象。但是,同时,我想确保在创建对象时不会抛出异常。可能吗。确保初始化工作正常,但不会引发异常
现在我正在做一个例子。我想let
的第一个变种,以便它可以跨范例重用。
first_object= nil
expect{first_object= StandaloneG28::Forms::G28.new(attorey_profile,application_manager: appManager)}.to_not raise_exception
expect{Pdf::AttributeMappings::FillableG28Applicant.new(first_object).export(false)}.to_not raise_exception
expect{Pdf::AttributeMappings::FillableG28Sponsor.new(first_object).export(false)}.to_not raise_exception
attorney_profile和application_manager是在外部环境中定义的。
聪明..从来没有想过这个,虽然我知道这个懒惰的评价,并在“我想让”的问题中说。深夜从未帮助任何人。 – Rpant
hehe yep ...自己做了很多次,回答盯着我的脸...这是额外的一双新鲜眼睛帮助:) – David