forked from freeCodeCamp/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.thor
More file actions
36 lines (29 loc) · 680 Bytes
/
test.thor
File metadata and controls
36 lines (29 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'pry'
class TestCLI < Thor
def self.to_s
'Test'
end
default_command :all
def initialize(*args)
$LOAD_PATH.unshift 'test'
super
end
desc 'all', 'Run all tests'
def all
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
desc 'coverage', 'Coverage report for core tests'
def coverage
ENV['COVERAGE'] = 'true'
require_relative '../../test/test_helper'
self.all
end
end