-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_spec.rb
executable file
·39 lines (34 loc) · 1.09 KB
/
test_spec.rb
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
require File.dirname(__FILE__) + '/spec_helper'
class SuiteTester
def initialize(suitename)
@suitename = suitename
end
def run
f = File.open("#{@suitename}", 'r')
cases = eval(f.read)
cases.each { |k, v|
casefile = File.new("#{@@output}/test_case.config", 'w');
casefile.write(v.inspect);
casefile.close;
#system("spec --format nested ./case_spec.rb")
system("#{@@rspec} ./case_spec.rb")
}
f.close
end
end
describe "Boss performance test - suite" do
before(:all) do
Dir.mkdir("#{@@output}") if not File::directory?("#{@@output}")
end
it "should run all test cases included in specified config file" do
suites = Dir.glob("#{@@suite}")
suites.each { |suitefile|
tester = SuiteTester.new(suitefile)
tester.run;
puts "***********************************************"
}
end
after(:all) do
File.unlink("#{@@output}/test_case.config") if File.exists?("#{@@output}/test_case.config")
end
end