2013-10-24 20:25:52 +02:00
|
|
|
require 'pry'
|
|
|
|
|
|
|
|
class TestCLI < Thor
|
|
|
|
def self.to_s
|
|
|
|
'Test'
|
|
|
|
end
|
|
|
|
|
|
|
|
default_command :all
|
|
|
|
|
2015-01-03 16:42:01 +01:00
|
|
|
def initialize(*args)
|
|
|
|
$LOAD_PATH.unshift 'test'
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
2013-10-24 20:25:52 +02:00
|
|
|
desc 'all', 'Run all tests'
|
|
|
|
def all
|
|
|
|
Dir['test/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
|
|
|
|
end
|
2015-01-03 16:42:01 +01:00
|
|
|
|
|
|
|
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
|
2013-10-24 20:25:52 +02:00
|
|
|
end
|