History

Add thor tasks for running individual test suites

Thibaut committed 11 years ago

Commit 85b6d841 parent e9d9bcd2 files · +17 −1Browse files

Unified · Split

2 files
  1. README.md +2 −0
  2. lib/tasks/test.thor +15 −1
README.md+2−0
@@ -115,6 +115,8 @@ for usage instructions. · 114 unmodified lines
115115
116116 # Tests
117117 thor test:all # Run all tests
118+thor test:docs # Run "Docs" tests
119+thor test:app # Run "App" tests
118120
119121 # Assets
120122 thor assets:compile # Compile assets (not required in development mode)
lib/tasks/test.thor+15−1
@@ -7,9 +7,23 @@ class TestCLI < Thor · 6 unmodified lines
77
88 default_command :all
99
10+ def initialize(*args)
11+ $LOAD_PATH.unshift 'test'
12+ super
13+ end
14+
1015 desc 'all', 'Run all tests'
1116 def all
12− $LOAD_PATH.unshift 'test'
1317 Dir['test/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
1418 end
19+
20+ desc 'docs', 'Run "Docs" tests'
21+ def docs
22+ Dir['test/lib/docs/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
23+ end
24+
25+ desc 'app', 'Run "App" tests'
26+ def app
27+ require 'app_test'
28+ end
1529 end