diff --git a/README.md b/README.md index c935d8a3..c018922c 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,8 @@ for usage instructions. # Tests thor test:all # Run all tests +thor test:docs # Run "Docs" tests +thor test:app # Run "App" tests # Assets thor assets:compile # Compile assets (not required in development mode) diff --git a/lib/tasks/test.thor b/lib/tasks/test.thor index 5a654ed4..e68fec8f 100644 --- a/lib/tasks/test.thor +++ b/lib/tasks/test.thor @@ -7,9 +7,23 @@ class TestCLI < Thor default_command :all + def initialize(*args) + $LOAD_PATH.unshift 'test' + super + end + desc 'all', 'Run all tests' def all - $LOAD_PATH.unshift 'test' Dir['test/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require)) end + + desc 'docs', 'Run "Docs" tests' + def docs + Dir['test/lib/docs/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require)) + end + + desc 'app', 'Run "App" tests' + def app + require 'app_test' + end end