lib/autotest_notification.rb in autotest-notification-2.3.0 vs lib/autotest_notification.rb in autotest-notification-2.3.1

- old
+ new

@@ -25,11 +25,16 @@ self.expiration_in_seconds = 3 end Autotest.add_hook :ran_command do |at| - result = at.results.is_a?(Array) ? at.results.last : at.results.split("\n").last - + + result = if at.results.is_a?(Array) + at.results.last == "\n" ? at.results[-2] : at.results.last + else + at.results.split("\n").last + end + if result %w{ test assertion error example pending failure }.each { |x| instance_variable_set "@#{x}s", result[/(\d+) #{x}/, 1].to_i } case result when /test/