2015-05-09 57 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

相關問題