-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
58 lines (50 loc) · 1.21 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
require 'rake'
require 'bundler/gem_helper'
require './test/setup'
Dir['./test/**/test__*.rb'].each { |f| require f }
namespace :test do
def run regex, unit
puts "\n***\nTesting #{unit} ..."
session = session(unit)
session.run regex, :trace => true
puts session.failures if session.failed?
puts session.summary
session.exit_code == 0 || fail
end
def session unit
session = Specular.new
session.boot do
include Sonar
include HttpSpecHelper
end
session.before do |tested_app|
if tested_app && EUtils.is_app?(tested_app)
tested_app.use Rack::Lint
if ['e-more', :ViewAPI].include?(unit)
app tested_app.mount {
view_fullpath File.expand_path('../test/e-more/view/templates', __FILE__)
}
else
app tested_app.mount
end
map tested_app.base_url
end
end
session
end
task :core do
run(/ECoreTest/, "e-core")
end
task :more do
run(/EMoreTest/, "e-more")
end
task :view do
run(/EMoreTest__View/, :ViewAPI)
end
end
task test: ['test:core', 'test:more']
task :overhead do
require './test/overhead/run'
end
task default: :test
Bundler::GemHelper.install_tasks