forked from wryobservations/rummager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
71 lines (56 loc) · 1.49 KB
/
Rakefile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require "rake/testtask"
require "rest-client"
require "logging"
PROJECT_ROOT = File.dirname(__FILE__)
LIBRARY_PATH = File.join(PROJECT_ROOT, "lib")
[PROJECT_ROOT, LIBRARY_PATH].each do |path|
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
end
require "config"
Dir[File.join(PROJECT_ROOT, 'lib/tasks/*.rake')].each { |file| load file }
desc "Run all the tests"
task "test" => ["test:units", "test:functionals", "test:integration"]
namespace "test" do
desc "Run the unit tests"
Rake::TestTask.new("units") do |t|
t.libs << "test"
t.test_files = FileList["test/unit/**/*_test.rb"]
t.verbose = true
end
desc "Run the functional tests"
Rake::TestTask.new("functionals") do |t|
t.libs << "test"
t.test_files = FileList["test/functional/**/*_test.rb"]
t.verbose = true
end
desc "Run the integration tests"
Rake::TestTask.new("integration") do |t|
t.libs << "test"
t.test_files = FileList["test/integration/**/*_test.rb"]
t.verbose = true
end
end
require "ci/reporter/rake/minitest" if ENV["RACK_ENV"] == "test"
task :default => :test
def logger
Logging.logger.root
end
def search_config
settings.search_config
end
def search_server
search_config.search_server
end
def index_names
case ENV["RUMMAGER_INDEX"]
when "all"
content_index_names
when String
[ENV["RUMMAGER_INDEX"]]
else
raise "You must specify an index name in RUMMAGER_INDEX, or 'all'"
end
end
def content_index_names
search_config.content_index_names
end