Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Run the tests' preflight checks under autotest, too
This includes a quick extract-method refactor (well, extract-task) so
you can run the preflight checks without running all the tests.
  • Loading branch information
chrisk committed May 12, 2013
1 parent da5f294 commit 587a465
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .autotest
Expand Up @@ -15,3 +15,7 @@ Autotest.add_hook :initialize do |autotest|
autotest.files_matching %r|^test/test_\w+\.rb$|
end
end

Autotest.add_hook :run_command do |at|
system "bundle exec rake test:preflight"
end
9 changes: 7 additions & 2 deletions Rakefile
Expand Up @@ -41,14 +41,19 @@ Rake::TestTask.new(:test) do |test|
# util/cli/ArgumentProcessor.java.
test.ruby_opts << "--debug" if RUBY_PLATFORM == "java"
end
Rake::Task["test"].enhance [:print_header, :check_dependencies]
Rake::Task["test"].enhance ["test:preflight"]
Rake::Task["test"].clear_comments.add_description <<-DESC.gsub(/^ /, "")
Run pre-flight checks, then run all tests (default).
Run preflight checks, then all tests (default task).
Set COVERAGE_REPORT=1 to produce an HTML-formatted code-coverage
report during the run. It will be written to /coverage.
DESC

namespace :test do
desc "Perform all startup checks without running tests"
task :preflight => [:print_header, :check_dependencies]
end

task :default => :test


Expand Down

0 comments on commit 587a465

Please sign in to comment.