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.
Files changed (36) hide show
  1. data/History.md +7 -0
  2. data/README.md +71 -57
  3. data/app/assets/javascripts/konacha/iframe.js +40 -0
  4. data/app/assets/javascripts/konacha/parent.js +14 -0
  5. data/app/assets/javascripts/konacha/runner.js +45 -0
  6. data/app/assets/stylesheets/konacha.css +75 -0
  7. data/app/controllers/konacha/specs_controller.rb +6 -1
  8. data/app/models/konacha/spec.rb +1 -1
  9. data/app/views/konacha/specs/iframe.html.erb +18 -0
  10. data/app/views/konacha/specs/parent.html.erb +16 -0
  11. data/config/routes.rb +4 -2
  12. data/images/frame-select.png +0 -0
  13. data/konacha.gemspec +1 -1
  14. data/lib/konacha/engine.rb +1 -0
  15. data/lib/konacha/runner.rb +22 -57
  16. data/spec/controllers/specs_controller_spec.rb +4 -4
  17. data/spec/dummy/config/application.rb +1 -0
  18. data/spec/dummy/spec/isolated/errors/failing_iframe_spec.js.coffee +1 -0
  19. data/spec/dummy/spec/javascripts/{test_element_spec.js.coffee → body_spec.js.coffee} +4 -7
  20. data/spec/dummy/spec/javascripts/isolation/a_spec.js +6 -0
  21. data/spec/dummy/spec/javascripts/isolation/b_spec.js +6 -0
  22. data/spec/dummy/spec/javascripts/templating_spec.js +4 -4
  23. data/spec/dummy/spec/javascripts/ui_spec.js +7 -0
  24. data/spec/error_handling_spec.rb +33 -0
  25. data/spec/models/spec_spec.rb +1 -1
  26. data/spec/spec_helper.rb +5 -0
  27. data/spec/views/specs/{specs.html.erb_spec.rb → iframe.html.erb_spec.rb} +12 -8
  28. data/vendor/assets/javascripts/mocha.js +297 -114
  29. metadata +195 -180
  30. data/app/views/konacha/specs/specs.html.erb +0 -16
  31. data/lib/assets/javascripts/konacha.js +0 -20
  32. data/lib/assets/javascripts/konacha/runner.js +0 -50
  33. data/lib/assets/javascripts/konacha/server.js +0 -6
  34. data/lib/assets/stylesheets/konacha.css +0 -5
  35. data/spec/dummy/spec/javascripts/konacha_config.js +0 -2
  36. 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
- };
@@ -1,6 +0,0 @@
1
- window.Konacha = {
2
- mochaOptions: {
3
- ui: 'bdd',
4
- reporter: mocha.reporters.HTML
5
- }
6
- };
@@ -1,5 +0,0 @@
1
- /* Keep #konacha div visible so we can test against element visibility */
2
- #konacha {
3
- height: 0 ! important;
4
- overflow: hidden ! important;
5
- }
@@ -1,2 +0,0 @@
1
- // ignore the following globals during leak detection
2
- Konacha.mochaOptions.globals = ['YUI'];
@@ -1,9 +0,0 @@
1
- //= require spec_helper
2
-
3
- describe("Konacha.mochaOptions", function(){
4
- it("overrides the default globals ignore", function(){
5
- var options = Konacha.mochaOptions;
6
- options.globals.should.not.be.undefined;
7
- options.globals.should.eql(['YUI']);
8
- });
9
- });