konacha 1.5.1 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +7 -0
- data/README.md +71 -57
- data/app/assets/javascripts/konacha/iframe.js +40 -0
- data/app/assets/javascripts/konacha/parent.js +14 -0
- data/app/assets/javascripts/konacha/runner.js +45 -0
- data/app/assets/stylesheets/konacha.css +75 -0
- data/app/controllers/konacha/specs_controller.rb +6 -1
- data/app/models/konacha/spec.rb +1 -1
- data/app/views/konacha/specs/iframe.html.erb +18 -0
- data/app/views/konacha/specs/parent.html.erb +16 -0
- data/config/routes.rb +4 -2
- data/images/frame-select.png +0 -0
- data/konacha.gemspec +1 -1
- data/lib/konacha/engine.rb +1 -0
- data/lib/konacha/runner.rb +22 -57
- data/spec/controllers/specs_controller_spec.rb +4 -4
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/spec/isolated/errors/failing_iframe_spec.js.coffee +1 -0
- data/spec/dummy/spec/javascripts/{test_element_spec.js.coffee → body_spec.js.coffee} +4 -7
- data/spec/dummy/spec/javascripts/isolation/a_spec.js +6 -0
- data/spec/dummy/spec/javascripts/isolation/b_spec.js +6 -0
- data/spec/dummy/spec/javascripts/templating_spec.js +4 -4
- data/spec/dummy/spec/javascripts/ui_spec.js +7 -0
- data/spec/error_handling_spec.rb +33 -0
- data/spec/models/spec_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/views/specs/{specs.html.erb_spec.rb → iframe.html.erb_spec.rb} +12 -8
- data/vendor/assets/javascripts/mocha.js +297 -114
- metadata +195 -180
- data/app/views/konacha/specs/specs.html.erb +0 -16
- data/lib/assets/javascripts/konacha.js +0 -20
- data/lib/assets/javascripts/konacha/runner.js +0 -50
- data/lib/assets/javascripts/konacha/server.js +0 -6
- data/lib/assets/stylesheets/konacha.css +0 -5
- data/spec/dummy/spec/javascripts/konacha_config.js +0 -2
- data/spec/dummy/spec/javascripts/konacha_config_spec.js +0 -9
@@ -1,16 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
5
|
-
<title>Konacha Tests</title>
|
6
|
-
<%= stylesheet_link_tag "mocha", :debug => false %>
|
7
|
-
<%= stylesheet_link_tag "konacha", :debug => false %>
|
8
|
-
<%= javascript_include_tag "mocha", "chai", "konacha/#{Konacha.mode}", :debug => false %>
|
9
|
-
<%= javascript_include_tag("konacha_config", :debug => false) if Rails.application.assets.find_asset('konacha_config') %>
|
10
|
-
<%= javascript_include_tag "konacha", :debug => false %>
|
11
|
-
<%= spec_include_tag *@specs %>
|
12
|
-
</head>
|
13
|
-
<body>
|
14
|
-
<div id="mocha"></div>
|
15
|
-
</body>
|
16
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
1
|
-
mocha.setup(Konacha.mochaOptions);
|
2
|
-
|
3
|
-
mocha.suite.beforeEach(function () {
|
4
|
-
var e = document.getElementById('konacha');
|
5
|
-
if (e) {
|
6
|
-
e.parentNode.removeChild(e);
|
7
|
-
}
|
8
|
-
|
9
|
-
e = document.createElement("div");
|
10
|
-
e.id = "konacha";
|
11
|
-
document.body.appendChild(e);
|
12
|
-
});
|
13
|
-
|
14
|
-
var expect = chai.expect,
|
15
|
-
should = chai.should(),
|
16
|
-
assert = chai.assert;
|
17
|
-
|
18
|
-
window.onload = function () {
|
19
|
-
mocha.run();
|
20
|
-
};
|
@@ -1,50 +0,0 @@
|
|
1
|
-
window.Konacha = {
|
2
|
-
dots:"",
|
3
|
-
|
4
|
-
mochaOptions: {
|
5
|
-
ui: 'bdd',
|
6
|
-
|
7
|
-
reporter: function (runner) {
|
8
|
-
window.mocha.reporters.Base.call(this, runner);
|
9
|
-
|
10
|
-
runner.on('start', function () {
|
11
|
-
Konacha.results = [];
|
12
|
-
});
|
13
|
-
|
14
|
-
runner.on('pass', function (test) {
|
15
|
-
Konacha.dots += ".";
|
16
|
-
Konacha.results.push({
|
17
|
-
name:test.title,
|
18
|
-
passed:true
|
19
|
-
});
|
20
|
-
});
|
21
|
-
|
22
|
-
runner.on('fail', function (test) {
|
23
|
-
Konacha.dots += "F";
|
24
|
-
Konacha.results.push({
|
25
|
-
name:test.title,
|
26
|
-
passed:false,
|
27
|
-
message:test.err.message,
|
28
|
-
trace:test.err.stack
|
29
|
-
});
|
30
|
-
});
|
31
|
-
|
32
|
-
runner.on('pending', function (test) {
|
33
|
-
Konacha.dots += "P";
|
34
|
-
Konacha.results.push({
|
35
|
-
name:test.title,
|
36
|
-
passed:false,
|
37
|
-
pending:true
|
38
|
-
});
|
39
|
-
});
|
40
|
-
|
41
|
-
runner.on('end', function () {
|
42
|
-
Konacha.done = true;
|
43
|
-
});
|
44
|
-
}
|
45
|
-
},
|
46
|
-
|
47
|
-
getResults:function () {
|
48
|
-
return JSON.stringify(Konacha.results);
|
49
|
-
}
|
50
|
-
};
|