From de595983c59a0e336713badcfb49ef6a9aac0d17 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Thu, 23 Jan 2025 16:18:34 -0800 Subject: [PATCH] yak-shaving cleanup / reorg --- bin/test | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/bin/test b/bin/test index 9a70167..98e192b 100755 --- a/bin/test +++ b/bin/test @@ -2,14 +2,20 @@ require "fileutils" APP_ROOT = File.expand_path("..", __dir__) + +# Run coverage checks during rspec ENV['COVERAGE'] = '1' + +# Required for the DB down/up test ENV['DISABLE_DATABASE_ENVIRONMENT_CHECK'] = '1' +# Test commands (to be exec'd in order) +TESTS = [ + %w(rspec -f html), + %w(rubocop), + %w(rails --trace db:drop db:create db:migrate), +] + FileUtils.chdir APP_ROOT do - # Runs all the tests sequentially, exiting 0 if all succeed and 1 otherwise. - exit [ - %w(rspec -f html), - %w(rubocop), - %w(rails --trace db:drop db:create db:migrate), - ].reduce(true) { |passfail, cmd| system(*cmd) && passfail } + exit TESTS.reduce(true) { |passfail, cmd| system(*cmd) && passfail } end