Slide 17
Slide 17 text
QUICKFIX: TESTS
require 'rspec/core/formatters/base_text_formatter'
module RSpec
module Core
module Formatters
class QuickfixFormatter < BaseTextFormatter
RSpec::Core::Formatters.register self, :example_failed
def initialize(output)
@output = output
end
def example_failed(notification)
@output << format(notification) + "\n"
end
def format(notification)
fmt = "%s: %s" % [notification.example.location, notification.exception.message]
fmt.gsub("\n", ' ')[0,160]
end
end
end
end
end
http://git.io/vCwCw