FIX: Turbo tests exit codes

FIX: Turbo tests exit codes

diff --git a/bin/turbo_rspec b/bin/turbo_rspec
index e0af6b3..035fae7 100755
--- a/bin/turbo_rspec
+++ b/bin/turbo_rspec
@@ -50,8 +50,15 @@ formatters.each do |formatter|
   end
 end
 
-TurboTests::Runner.run(
-  formatters: formatters,
-  files: ARGV.empty? ? ["spec"] : ARGV,
-  verbose: verbose
-)
+success =
+  TurboTests::Runner.run(
+    formatters: formatters,
+    files: ARGV.empty? ? ["spec"] : ARGV,
+    verbose: verbose
+  )
+
+if success
+  exit 0
+else
+  exit 1
+end
diff --git a/lib/turbo_tests/runner.rb b/lib/turbo_tests/runner.rb
index ad9ca2b..ce24c6b 100644
--- a/lib/turbo_tests/runner.rb
+++ b/lib/turbo_tests/runner.rb
@@ -53,6 +53,8 @@ module TurboTests
       @reporter.finish
 
       @threads.each(&:join)
+
+      @reporter.failed_examples.empty?
     end
 
     protected

GitHub sha: c3db5925

2 Likes