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
|
# File 'lib/spade/package/spec/support/core_test.rb', line 28
def run_core_tests(path, &block)
describe "#{path}" do
rootdir = File.expand_path(File.join(__FILE__, '/../../../'));
context = Spade::MainContext.new(:rootdir => rootdir) do |ctx|
ctx['checkRSpec'] = lambda do |status, test_info, message|
it "#{test_info.module.name}: #{test_info.name}" do
if status == 'warnings' && message == "Not Yet Implemented"
pending
else
[status.to_s, message.to_s].should be_ct_success
end
end
end
ctx.eval "var Ct;\ntry {\nCt = require('core-test');\n} catch (e) { }\n\nif (Ct) {\nRubyLogger = require('core-test/utils').extend(Ct.DefaultLogger, {\n add: function(status, testInfo, message){\n checkRSpec(status, testInfo, message);\n }\n});\nCt.defaultLogger = new RubyLogger('ruby');\n\nrequire('file:\#{path}');\n\nCt.run();\n} else {\nconsole.log(\"CoreTest is not installed. Use `spade install core-test`.\");\n}\n"
end
end
end
|