Add thor tasks for running individual test suites

pull/165/head
Thibaut 10 years ago
parent e9d9bcd196
commit 85b6d84bc3

@ -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)

@ -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

Loading…
Cancel
Save