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
115 115
116# Tests116# Tests
117thor test:all # Run all tests117thor test:all # Run all tests
118thor test:docs # Run "Docs" tests
119thor test:app # Run "App" tests
118 120
119# Assets121# Assets
120thor assets:compile # Compile assets (not required in development mode)122thor 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
7 7
8 default_command :all8 default_command :all
9 9
10 def initialize(*args)
11 $LOAD_PATH.unshift 'test'
12 super
13 end
14
10 desc 'all', 'Run all tests'15 desc 'all', 'Run all tests'
11 def all16 def all
12 $LOAD_PATH.unshift 'test'
13 Dir['test/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))17 Dir['test/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
14 end18 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
15end29end