guard-jasmine 1.18.1 → 1.18.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3f0194064115dd7fe83860b4bf1f8569b17889b
4
- data.tar.gz: 1250cd01700c45d814bace7e5fe6b3872c761bb0
3
+ metadata.gz: dad3977ff6ae64bcbfadd40d745008ac7e7d4f8f
4
+ data.tar.gz: 833453756677888df558cb1135bc631044385f98
5
5
  SHA512:
6
- metadata.gz: a02ec1f101f74327c9cdbeef8f4f3c21d477ddaefc6507ba4239597dc8cc42affb1894ced70faa08689b5b4cb9e1595da195418ce826324fea66c90325444b31
7
- data.tar.gz: f3a1155fa48c21575dc50eaeb3da3470ff263ae12cd0c7adcc5bc46d5c46218a42fb6c22535a678f592a17755da3109b5a6611277fc15c4d31305cc6a277428c
6
+ metadata.gz: c63479cc2526d6747ed95099b8940f96ee0a58092b056461ddcab834e6f0cdb9181883703e9d6016f9e77445934d3883290db031af416dd41e2226b7ed0cbf58
7
+ data.tar.gz: b56f521141ed31168f4c698e58a949f34b149c89a2b64643051d53e42f5326fa07b4554d28bbf61b72929b146c90e279d0189b4d9d882ec02255eb172133d9a7
@@ -193,6 +193,7 @@ module Guard
193
193
  runner_options[:junit] = options.junit
194
194
  runner_options[:junit_consolidate] = options.junit_consolidate
195
195
  runner_options[:junit_save_path] = options.junit_save_path
196
+ runner_options[:is_cli] = true
196
197
 
197
198
  ::Guard::UI.options = ::Guard::UI.options.merge({ :template => ':message' })
198
199
 
@@ -1,4 +1,3 @@
1
- // Generated by CoffeeScript 1.6.3
2
1
  (function() {
3
2
  var currentSpecId, errors, fs, getXmlResults, jasmineAvailable, jasmineMissing, jasmineReady, logs, options, overloadPageEvaluate, page, replaceFunctionPlaceholders, resultsKey, setupWriteFileFunction, specsDone, specsReady, specsTimedout, waitFor;
4
3
 
@@ -40,6 +39,7 @@
40
39
 
41
40
  page.onConsoleMessage = function(msg, line, source) {
42
41
  var result;
42
+
43
43
  if (/^RUNNER_END$/.test(msg)) {
44
44
  result = page.evaluate(function() {
45
45
  return window.reporter.runnerResult;
@@ -58,6 +58,7 @@
58
58
 
59
59
  page.onInitialized = function() {
60
60
  var setupReporters;
61
+
61
62
  overloadPageEvaluate(page);
62
63
  setupWriteFileFunction(page, resultsKey, fs.separator);
63
64
  page.injectJs('lib/console.js');
@@ -82,6 +83,7 @@
82
83
 
83
84
  getXmlResults = function(page, key) {
84
85
  var getWindowObj;
86
+
85
87
  getWindowObj = function() {
86
88
  return window["%resultsObj%"] || {};
87
89
  };
@@ -92,6 +94,7 @@
92
94
 
93
95
  replaceFunctionPlaceholders = function(fn, replacements) {
94
96
  var match, p;
97
+
95
98
  if (replacements && typeof replacements === 'object') {
96
99
  fn = fn.toString();
97
100
  for (p in replacements) {
@@ -119,6 +122,7 @@
119
122
 
120
123
  setupWriteFileFunction = function(page, key, path_separator) {
121
124
  var saveData;
125
+
122
126
  saveData = function() {
123
127
  window["%resultsObj%"] = {};
124
128
  window.fs_path_separator = "%fs_path_separator%";
@@ -156,8 +160,10 @@
156
160
 
157
161
  jasmineMissing = function() {
158
162
  var error, text;
163
+
159
164
  text = page.evaluate(function() {
160
165
  var _ref;
166
+
161
167
  return (_ref = document.getElementsByTagName('body')[0]) != null ? _ref.innerText : void 0;
162
168
  });
163
169
  if (text) {
@@ -180,8 +186,10 @@
180
186
 
181
187
  specsTimedout = function() {
182
188
  var error, text;
189
+
183
190
  text = page.evaluate(function() {
184
191
  var _ref;
192
+
185
193
  return (_ref = document.getElementsByTagName('body')[0]) != null ? _ref.innerText : void 0;
186
194
  });
187
195
  if (text) {
@@ -198,6 +206,7 @@
198
206
 
199
207
  specsDone = function() {
200
208
  var filename, output, xml_results;
209
+
201
210
  if (options.junit === true) {
202
211
  xml_results = getXmlResults(page, resultsKey);
203
212
  for (filename in xml_results) {
@@ -211,6 +220,7 @@
211
220
 
212
221
  waitFor = function(test, ready, timeout, timeoutFunction) {
213
222
  var condition, interval, start, wait;
223
+
214
224
  if (timeout == null) {
215
225
  timeout = 10000;
216
226
  }
@@ -1,4 +1,3 @@
1
- // Generated by CoffeeScript 1.6.3
2
1
  (function() {
3
2
  var Console,
4
3
  __slice = [].slice;
@@ -6,29 +5,35 @@
6
5
  Console = (function() {
7
6
  function Console(console) {
8
7
  var log;
8
+
9
9
  log = console.log;
10
10
  console.log = function() {
11
11
  var args;
12
+
12
13
  args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
13
14
  return log.call(console, Console.format.apply(Console, args));
14
15
  };
15
16
  console.info = function() {
16
17
  var args;
18
+
17
19
  args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
18
20
  return log.call(console, "INFO: " + (Console.format.apply(Console, args)));
19
21
  };
20
22
  console.warn = function() {
21
23
  var args;
24
+
22
25
  args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
23
26
  return log.call(console, "WARN: " + (Console.format.apply(Console, args)));
24
27
  };
25
28
  console.error = function() {
26
29
  var args;
30
+
27
31
  args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
28
32
  return log.call(console, "ERROR: " + (Console.format.apply(Console, args)));
29
33
  };
30
34
  console.debug = function() {
31
35
  var args;
36
+
32
37
  args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
33
38
  return log.call(console, "DEBUG: " + (Console.format.apply(Console, args)));
34
39
  };
@@ -39,6 +44,7 @@
39
44
  Console.format = function() {
40
45
  var arg, args, result, _i, _len,
41
46
  _this = this;
47
+
42
48
  args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
43
49
  result = [];
44
50
  if (typeof args[0] === 'string' && /%[sdifo]/gi.test(args[0])) {
@@ -56,6 +62,7 @@
56
62
 
57
63
  Console.inspect = function(object, type) {
58
64
  var match, result;
65
+
59
66
  switch (type) {
60
67
  case '%s':
61
68
  result = String(object);
@@ -93,6 +100,7 @@
93
100
 
94
101
  Console.pp = function(object, depth) {
95
102
  var key, result, type, value, _i, _len;
103
+
96
104
  if (depth == null) {
97
105
  depth = 0;
98
106
  }
@@ -1,4 +1,3 @@
1
- // Generated by CoffeeScript 1.6.3
2
1
  (function() {
3
2
  var ConsoleReporter;
4
3
 
@@ -27,6 +26,7 @@
27
26
 
28
27
  ConsoleReporter.prototype.reportSpecResults = function(spec) {
29
28
  var messages, result, specResult, _base, _i, _len, _name, _ref;
29
+
30
30
  if (!spec.results().skipped) {
31
31
  specResult = {
32
32
  id: spec.id,
@@ -52,6 +52,7 @@
52
52
 
53
53
  ConsoleReporter.prototype.reportSuiteResults = function(suite) {
54
54
  var parent, suiteResult, _base, _ref;
55
+
55
56
  if (!suite.results().skipped) {
56
57
  suiteResult = {
57
58
  id: suite.id,
@@ -77,6 +78,7 @@
77
78
 
78
79
  ConsoleReporter.prototype.reportRunnerResults = function(runner) {
79
80
  var end, runtime;
81
+
80
82
  runtime = (new Date().getTime() - this.startTime) / 1000;
81
83
  this.runnerResult['passed'] = runner.results().failedCount === 0;
82
84
  this.runnerResult['stats'] = {
@@ -99,6 +101,7 @@
99
101
 
100
102
  ConsoleReporter.prototype.addNestedSuites = function(suiteResult) {
101
103
  var suite, _i, _len, _ref, _results;
104
+
102
105
  if (this.nestedSuiteResults[suiteResult.id]) {
103
106
  _ref = this.nestedSuiteResults[suiteResult.id];
104
107
  _results = [];
@@ -113,6 +116,7 @@
113
116
 
114
117
  ConsoleReporter.prototype.removeEmptySuites = function(suiteResult) {
115
118
  var suite, suites, _i, _len, _ref;
119
+
116
120
  suites = [];
117
121
  _ref = suiteResult.suites;
118
122
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -1,4 +1,3 @@
1
- // Generated by CoffeeScript 1.6.3
2
1
  (function() {
3
2
  var Result;
4
3
 
@@ -12,8 +11,10 @@
12
11
 
13
12
  Result.prototype.addLogs = function(suite) {
14
13
  var id, s, spec;
14
+
15
15
  suite.suites = (function() {
16
16
  var _i, _len, _ref, _results;
17
+
17
18
  _ref = suite.suites;
18
19
  _results = [];
19
20
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -25,6 +26,7 @@
25
26
  if (suite.specs) {
26
27
  suite.specs = (function() {
27
28
  var _i, _len, _ref, _results;
29
+
28
30
  _ref = suite.specs;
29
31
  _results = [];
30
32
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -45,8 +47,10 @@
45
47
 
46
48
  Result.prototype.addErrors = function(suite) {
47
49
  var id, s, spec;
50
+
48
51
  suite.suites = (function() {
49
52
  var _i, _len, _ref, _results;
53
+
50
54
  _ref = suite.suites;
51
55
  _results = [];
52
56
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -58,6 +62,7 @@
58
62
  if (suite.specs) {
59
63
  suite.specs = (function() {
60
64
  var _i, _len, _ref, _results;
65
+
61
66
  _ref = suite.specs;
62
67
  _results = [];
63
68
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -78,6 +83,7 @@
78
83
 
79
84
  Result.prototype.addGlobalError = function(suite) {
80
85
  var b, err, errMsg, globalErrors, noSpecs, noSuites, _i, _len, _ref;
86
+
81
87
  noSuites = !suite.suites || suite.suites.length === 0;
82
88
  noSpecs = !suite.specs || suite.specs.length === 0;
83
89
  globalErrors = this.errors[-1] && this.errors[-1].length !== 0;
@@ -96,8 +102,10 @@
96
102
 
97
103
  Result.prototype.cleanResult = function(suite) {
98
104
  var s, spec, _i, _len, _ref;
105
+
99
106
  suite.suites = (function() {
100
107
  var _i, _len, _ref, _results;
108
+
101
109
  _ref = suite.suites;
102
110
  _results = [];
103
111
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -180,15 +180,20 @@ module Guard
180
180
 
181
181
  begin
182
182
  result = MultiJson.decode(json, { max_nesting: false })
183
+ raise 'No response from Jasmine runner' if !result && options[:is_cli]
183
184
 
184
185
  if result['error']
185
- notify_runtime_error(result, options)
186
- else
186
+ if options[:is_cli]
187
+ raise 'An error occurred in the Jasmine runner'
188
+ else
189
+ notify_runtime_error(result, options)
190
+ end
191
+ elsif result
187
192
  result['file'] = file
188
193
  notify_spec_result(result, options)
189
194
  end
190
195
 
191
- if result['coverage'] && options[:coverage]
196
+ if result && result['coverage'] && options[:coverage]
192
197
  notify_coverage_result(result['coverage'], file, options)
193
198
  end
194
199
 
@@ -196,10 +201,18 @@ module Guard
196
201
 
197
202
  rescue MultiJson::DecodeError => e
198
203
  if e.data == ''
199
- Formatter.error('No response from the Jasmine runner!')
204
+ if options[:is_cli]
205
+ raise 'No response from Jasmine runner'
206
+ else
207
+ Formatter.error('No response from the Jasmine runner!')
208
+ end
200
209
  else
201
- Formatter.error("Cannot decode JSON from PhantomJS runner: #{ e.message }")
202
- Formatter.error("JSON response: #{ e.data }")
210
+ if options[:is_cli]
211
+ raise 'Cannot decode JSON from PhantomJS runner'
212
+ else
213
+ Formatter.error("Cannot decode JSON from PhantomJS runner: #{ e.message }")
214
+ Formatter.error("JSON response: #{ e.data }")
215
+ end
203
216
  end
204
217
  ensure
205
218
  output.close
@@ -1,6 +1,6 @@
1
1
  module Guard
2
2
  module JasmineVersion
3
3
  # Guard::Jasmine version that is used for the Gem specification
4
- VERSION = '1.18.1'
4
+ VERSION = '1.18.2'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.1
4
+ version: 1.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard