2015-05-09 75 views
0

我正在生成一些自动规格,我希望有一个自定义的成功消息与期望成功的时代。 例如,我想喜欢的一份报告:如何添加自定义文本成功rspec消息

Opportunity 
    .rating_info 
    where the real estate kind is Monoambiente 
     and there aren't assigned values 
     is 0 
     when there are multiple combinations 
     is has the expected value(run 45 different combinations) 

回答

4

似乎it's possible through use of a custom formatter

class PedrazaFormatter < BaseTextFormatter 
     Formatters.register self, :example_passed 

     def init(times = 0) 
      self.times = times 
     end 

     def example_passed(_notification) 
      output.print "Test was successful #{self.times} times" 
     end 
end 

我希望这有助于。让我知道你是否有进一步的担忧。

+0

@AugustoPedraza如果这对您有帮助,您是否愿意点击绿色复选标记? – hd1

相关问题