snapdragon 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,6 @@
1
- #
2
- # DO NOT Edit this file. Canonical version of Jasmine lives in the repo's package.json. This file is generated
3
- # by a grunt task when the standalone release is built.
4
- #
5
1
  module Jasmine
6
2
  module Core
7
- VERSION = "2.0.0.alpha"
3
+ VERSION = "1.3.1"
8
4
  end
9
5
  end
6
+
@@ -1,4 +1,4 @@
1
- getJasmineRequireObj().ConsoleReporter = function() {
1
+ jasmine.ConsoleReporter = function() {
2
2
  function ConsoleReporter(options) {
3
3
  var print = function(msg) { console.log(msg); },
4
4
  showColors = options.showColors || true,
@@ -9,6 +9,8 @@ getJasmineRequireObj().ConsoleReporter = function() {
9
9
  failedSpecs = [],
10
10
  pendingSpecs = [],
11
11
  pendingCount,
12
+ startTimestamp,
13
+ endTimestamp
12
14
  ansi = {
13
15
  green: '\033[32m',
14
16
  red: '\033[31m',
@@ -16,7 +18,12 @@ getJasmineRequireObj().ConsoleReporter = function() {
16
18
  none: '\033[0m'
17
19
  };
18
20
 
19
- this.jasmineStarted = function() {
21
+ this.log = function() {
22
+ };
23
+
24
+ // "reportRunnerStarting",
25
+ this.reportRunnerStarting = function() {
26
+ startTimestamp = new Date().getTime();
20
27
  specCount = 0;
21
28
  failureCount = 0;
22
29
  passedCount = 0;
@@ -25,14 +32,29 @@ getJasmineRequireObj().ConsoleReporter = function() {
25
32
  printNewline();
26
33
  };
27
34
 
28
- this.jasmineDone = function(options) {
29
- if (pendingCount > 0) {
30
- print("Pending:");
31
- }
35
+ // "reportSuiteResults",
36
+ this.reportSuitResults = function() {
37
+ };
32
38
 
33
- for (var i = 0; i < pendingSpecs.length; i++) {
34
- specPendingDetails(pendingSpecs[i]);
35
- }
39
+ // "reportSpecStarting",
40
+ this.reportSpecStarting = function() {
41
+ };
42
+
43
+ // "reportRunnerResults",
44
+ this.reportRunnerResults = function(options) {
45
+ endTimestamp = new Date().getTime();
46
+
47
+ // I have commented out the pending section below because v1.3.1 of
48
+ // jasmine doesn't have a concept of pending. It has a concept of
49
+ // skipped when you filter tests using the spec query param.
50
+
51
+ // if (pendingCount > 0) {
52
+ // print("Pending:");
53
+ // }
54
+
55
+ // for (var i = 0; i < pendingSpecs.length; i++) {
56
+ // specPendingDetails(pendingSpecs[i]);
57
+ // }
36
58
 
37
59
  if (failureCount > 0) {
38
60
  print("Failures:");
@@ -46,16 +68,16 @@ getJasmineRequireObj().ConsoleReporter = function() {
46
68
  var specCounts = specCount + " " + plural("example", specCount) + ", " + failureCount + " " + plural("failure", failureCount);
47
69
 
48
70
  if (pendingCount) {
49
- specCounts += ", " + pendingCount + " pending";
71
+ specCounts += ", " + pendingCount + " skipped";
50
72
  }
51
73
 
52
- var seconds = options.executionTime / 1000;
74
+ var seconds = (endTimestamp - startTimestamp) / 1000.0;
53
75
  print("Finished in " + seconds + " " + plural("second", seconds));
54
76
 
55
77
  if (failureCount > 0) { // have any failures
56
78
  print(colored("red", specCounts));
57
- } else if (pendingCount > 0) {
58
- print(colored("yellow", specCounts));
79
+ // } else if (pendingCount > 0) {
80
+ // print(colored("yellow", specCounts));
59
81
  } else {
60
82
  print(colored("green", specCounts));
61
83
  }
@@ -63,26 +85,22 @@ getJasmineRequireObj().ConsoleReporter = function() {
63
85
  onComplete();
64
86
  };
65
87
 
66
- this.specDone = function(result) {
67
- if (result.status !== "disabled") {
88
+ // "reportSpecResults",
89
+ this.reportSpecResults = function(spec) {
90
+ var results = spec.results();
91
+
92
+ if (!results.skipped) { // not pending
68
93
  specCount++;
69
94
  }
70
95
 
71
- if (result.status == "pending") {
96
+ if (results.skipped) { // when you filter out tests with spec query param
72
97
  pendingCount++;
73
- pendingSpecs.push(result);
74
- return;
75
- }
76
-
77
- if (result.status == "passed") {
98
+ pendingSpecs.push(spec);
99
+ } else if (results.passed()) { // passed
78
100
  passedCount++;
79
- return;
80
- }
81
-
82
- if (result.status == "failed") {
101
+ } else { // failed
83
102
  failureCount++;
84
- failedSpecs.push(result);
85
- return;
103
+ failedSpecs.push(spec);
86
104
  }
87
105
  };
88
106
 
@@ -117,18 +135,19 @@ getJasmineRequireObj().ConsoleReporter = function() {
117
135
  return newArr.join("\n");
118
136
  }
119
137
 
120
- function specFailureDetails(result, failure_number) {
121
- print(indent(failure_number + ") " + result.fullName, 2));
138
+ function specFailureDetails(spec, failure_number) {
139
+ var results = spec.results();
140
+ print(indent(failure_number + ") " + spec.getFullName(), 2));
122
141
 
123
- for (var i = 0; i < result.failedExpectations.length; i++) {
124
- var failedExpectation = result.failedExpectations[i];
125
- print(colored("red", indent(failedExpectation.message, 6)));
142
+ for (var i = 0; i < results.items_.length; i++) {
143
+ var failedExpectation = results.items_[i];
144
+ print(indent(colored("red", failedExpectation.message), 6));
126
145
  }
127
146
  printNewline();
128
147
  }
129
148
 
130
- function specPendingDetails(result) {
131
- print(indent(colored("yellow", result.fullName), 2));
149
+ function specPendingDetails(spec) {
150
+ print(indent(colored("yellow", spec.getFullName()), 2));
132
151
  printNewline();
133
152
  }
134
153
  }
@@ -1,3 +1,3 @@
1
1
  module Snapdragon
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -4,16 +4,6 @@
4
4
 
5
5
  <script type="text/javascript" src="/resources/ConsoleReporter.js"></script>
6
6
 
7
- <script type="text/javascript" src="/jasmine-core/boot.js"></script>
8
-
9
- <script type="text/javascript">
10
- // standard jasmine code to add console reporter in the jasmine runner
11
- var env = jasmine.getEnv();
12
- var consoleReporterFunc = getJasmineRequireObj().ConsoleReporter();
13
- var consoleReporter = new consoleReporterFunc({});
14
- env.addReporter(consoleReporter);
15
- </script>
16
-
17
7
  <script type="text/javascript">
18
8
  // The implementation code the spec files being tested need
19
9
  <%= @suite.output_spec_dependencies %>
@@ -25,3 +15,36 @@
25
15
  <%= spec.read %>
26
16
  <% end %>
27
17
  </script>
18
+
19
+ <script type="text/javascript">
20
+ (function() {
21
+ var jasmineEnv = jasmine.getEnv();
22
+ jasmineEnv.updateInterval = 1000;
23
+
24
+ var htmlReporter = new jasmine.HtmlReporter();
25
+
26
+ jasmineEnv.addReporter(htmlReporter);
27
+
28
+ var consoleReporterFunc = jasmine.ConsoleReporter();
29
+ var consoleReporter = new consoleReporterFunc({});
30
+ jasmineEnv.addReporter(consoleReporter);
31
+
32
+ jasmineEnv.specFilter = function(spec) {
33
+ return htmlReporter.specFilter(spec);
34
+ };
35
+
36
+ var currentWindowOnload = window.onload;
37
+
38
+ window.onload = function() {
39
+ if (currentWindowOnload) {
40
+ currentWindowOnload();
41
+ }
42
+ execJasmine();
43
+ };
44
+
45
+ function execJasmine() {
46
+ jasmineEnv.execute();
47
+ }
48
+
49
+ })();
50
+ </script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapdragon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte
@@ -149,10 +149,9 @@ files:
149
149
  - spec/lib/snapdragon/spec_file_spec.rb
150
150
  - spec/lib/snapdragon/suite_spec.rb
151
151
  - spec/spec_helper.rb
152
- - lib/jasmine/lib/jasmine-core/boot/boot.js
153
- - lib/jasmine/lib/jasmine-core/boot.js
154
152
  - lib/jasmine/lib/jasmine-core/example/spec/PlayerSpec.js
155
153
  - lib/jasmine/lib/jasmine-core/example/spec/SpecHelper.js
154
+ - lib/jasmine/lib/jasmine-core/example/SpecRunner.html
156
155
  - lib/jasmine/lib/jasmine-core/example/src/Player.js
157
156
  - lib/jasmine/lib/jasmine-core/example/src/Song.js
158
157
  - lib/jasmine/lib/jasmine-core/jasmine-html.js
@@ -1,129 +0,0 @@
1
- /*
2
- Copyright (c) 2008-2013 Pivotal Labs
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining
5
- a copy of this software and associated documentation files (the
6
- "Software"), to deal in the Software without restriction, including
7
- without limitation the rights to use, copy, modify, merge, publish,
8
- distribute, sublicense, and/or sell copies of the Software, and to
9
- permit persons to whom the Software is furnished to do so, subject to
10
- the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- */
23
- // Jasmine boot.js for browser runners - exposes external/global interface, builds the Jasmine environment and executes it.
24
- (function() {
25
- window.jasmine = jasmineRequire.core(jasmineRequire);
26
- jasmineRequire.html(jasmine);
27
-
28
- var env = jasmine.getEnv();
29
-
30
- var jasmineInterface = {
31
- describe: function(description, specDefinitions) {
32
- return env.describe(description, specDefinitions);
33
- },
34
-
35
- xdescribe: function(description, specDefinitions) {
36
- return env.xdescribe(description, specDefinitions);
37
- },
38
-
39
- it: function(desc, func) {
40
- return env.it(desc, func);
41
- },
42
-
43
- xit: function(desc, func) {
44
- return env.xit(desc, func);
45
- },
46
-
47
- beforeEach: function(beforeEachFunction) {
48
- return env.beforeEach(beforeEachFunction);
49
- },
50
-
51
- afterEach: function(afterEachFunction) {
52
- return env.afterEach(afterEachFunction);
53
- },
54
-
55
- expect: function(actual) {
56
- return env.expect(actual);
57
- },
58
-
59
- pending: function() {
60
- return env.pending();
61
- },
62
-
63
- addMatchers: function(matchers) {
64
- return env.addMatchers(matchers);
65
- },
66
-
67
- spyOn: function(obj, methodName) {
68
- return env.spyOn(obj, methodName);
69
- },
70
-
71
- clock: env.clock,
72
- setTimeout: env.clock.setTimeout,
73
- clearTimeout: env.clock.clearTimeout,
74
- setInterval: env.clock.setInterval,
75
- clearInterval: env.clock.clearInterval,
76
-
77
- jsApiReporter: new jasmine.JsApiReporter(jasmine)
78
- };
79
-
80
- if (typeof window == "undefined" && typeof exports == "object") {
81
- extend(exports, jasmineInterface);
82
- } else {
83
- extend(window, jasmineInterface);
84
- }
85
-
86
- var queryString = new jasmine.QueryString({
87
- getWindowLocation: function() { return window.location; }
88
- });
89
-
90
- // TODO: move all of catching to raise so we don't break our brains
91
- var catchingExceptions = queryString.getParam("catch");
92
- env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
93
-
94
- var htmlReporter = new jasmine.HtmlReporter({
95
- env: env,
96
- queryString: queryString,
97
- onRaiseExceptionsClick: function() { queryString.setParam("catch", !env.catchingExceptions()); },
98
- getContainer: function() { return document.body; },
99
- createElement: function() { return document.createElement.apply(document, arguments); },
100
- createTextNode: function() { return document.createTextNode.apply(document, arguments); }
101
- });
102
-
103
- env.addReporter(jasmineInterface.jsApiReporter);
104
- env.addReporter(htmlReporter);
105
-
106
- var specFilter = new jasmine.HtmlSpecFilter({
107
- filterString: function() { return queryString.getParam("spec"); }
108
- });
109
-
110
- env.specFilter = function(spec) {
111
- return specFilter.matches(spec.getFullName());
112
- };
113
-
114
- var currentWindowOnload = window.onload;
115
-
116
- window.onload = function() {
117
- if (currentWindowOnload) {
118
- currentWindowOnload();
119
- }
120
- htmlReporter.initialize();
121
- env.execute();
122
- };
123
-
124
- function extend(destination, source) {
125
- for (var property in source) destination[property] = source[property];
126
- return destination;
127
- }
128
-
129
- }());
@@ -1,107 +0,0 @@
1
- // Jasmine boot.js for browser runners - exposes external/global interface, builds the Jasmine environment and executes it.
2
- (function() {
3
- window.jasmine = jasmineRequire.core(jasmineRequire);
4
- jasmineRequire.html(jasmine);
5
-
6
- var env = jasmine.getEnv();
7
-
8
- var jasmineInterface = {
9
- describe: function(description, specDefinitions) {
10
- return env.describe(description, specDefinitions);
11
- },
12
-
13
- xdescribe: function(description, specDefinitions) {
14
- return env.xdescribe(description, specDefinitions);
15
- },
16
-
17
- it: function(desc, func) {
18
- return env.it(desc, func);
19
- },
20
-
21
- xit: function(desc, func) {
22
- return env.xit(desc, func);
23
- },
24
-
25
- beforeEach: function(beforeEachFunction) {
26
- return env.beforeEach(beforeEachFunction);
27
- },
28
-
29
- afterEach: function(afterEachFunction) {
30
- return env.afterEach(afterEachFunction);
31
- },
32
-
33
- expect: function(actual) {
34
- return env.expect(actual);
35
- },
36
-
37
- pending: function() {
38
- return env.pending();
39
- },
40
-
41
- addMatchers: function(matchers) {
42
- return env.addMatchers(matchers);
43
- },
44
-
45
- spyOn: function(obj, methodName) {
46
- return env.spyOn(obj, methodName);
47
- },
48
-
49
- clock: env.clock,
50
- setTimeout: env.clock.setTimeout,
51
- clearTimeout: env.clock.clearTimeout,
52
- setInterval: env.clock.setInterval,
53
- clearInterval: env.clock.clearInterval,
54
-
55
- jsApiReporter: new jasmine.JsApiReporter(jasmine)
56
- };
57
-
58
- if (typeof window == "undefined" && typeof exports == "object") {
59
- extend(exports, jasmineInterface);
60
- } else {
61
- extend(window, jasmineInterface);
62
- }
63
-
64
- var queryString = new jasmine.QueryString({
65
- getWindowLocation: function() { return window.location; }
66
- });
67
-
68
- // TODO: move all of catching to raise so we don't break our brains
69
- var catchingExceptions = queryString.getParam("catch");
70
- env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
71
-
72
- var htmlReporter = new jasmine.HtmlReporter({
73
- env: env,
74
- queryString: queryString,
75
- onRaiseExceptionsClick: function() { queryString.setParam("catch", !env.catchingExceptions()); },
76
- getContainer: function() { return document.body; },
77
- createElement: function() { return document.createElement.apply(document, arguments); },
78
- createTextNode: function() { return document.createTextNode.apply(document, arguments); }
79
- });
80
-
81
- env.addReporter(jasmineInterface.jsApiReporter);
82
- env.addReporter(htmlReporter);
83
-
84
- var specFilter = new jasmine.HtmlSpecFilter({
85
- filterString: function() { return queryString.getParam("spec"); }
86
- });
87
-
88
- env.specFilter = function(spec) {
89
- return specFilter.matches(spec.getFullName());
90
- };
91
-
92
- var currentWindowOnload = window.onload;
93
-
94
- window.onload = function() {
95
- if (currentWindowOnload) {
96
- currentWindowOnload();
97
- }
98
- htmlReporter.initialize();
99
- env.execute();
100
- };
101
-
102
- function extend(destination, source) {
103
- for (var property in source) destination[property] = source[property];
104
- return destination;
105
- }
106
-
107
- }());