lib/xcpretty.rb in xcpretty-0.0.6 vs lib/xcpretty.rb in xcpretty-0.0.7

- old
+ new

@@ -1,9 +1,31 @@ require "xcpretty/version" require "xcpretty/printer" -require "xcpretty/printers/simple" -require "xcpretty/printers/rspec" +require "xcpretty/syntax" +require "xcpretty/formatters/formatter" +require "xcpretty/formatters/simple" +require "xcpretty/formatters/rspec" require "xcpretty/reporters/junit" module XCPretty - # Your code goes here... + class ExitStatus + + include XCPretty::Matchers + + POSSIBLE_FAILURES = [ + FAILING_TEST_MATCHER, + /\serror:\s/ + ] + + def self.code + $exit_status || 0 + end + + def self.handle(text) + POSSIBLE_FAILURES.detect do |failure| + $exit_status = 1 if text =~ failure + end + end + + end end +