guard-jasmine 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,7 +39,7 @@ page = require('webpage').create()
39
39
 
40
40
  # Used to collect log messages for later assignment to the spec
41
41
  #
42
- currentSpecId = 0
42
+ currentSpecId = -1
43
43
  logs = {}
44
44
 
45
45
  # Add logs to the given suite
@@ -75,7 +75,7 @@ page.onConsoleMessage = (msg, line, source) ->
75
75
  logs[currentSpecId] = []
76
76
 
77
77
  else
78
- logs[currentSpecId].push "#{ msg } in #{ source } (line #{ line })"
78
+ logs[currentSpecId].push("#{ msg } in #{ source } (line #{ line })") if currentSpecId isnt -1
79
79
 
80
80
  # Initialize the page before the JavaScript is run.
81
81
  #
@@ -145,26 +145,26 @@ module Guard
145
145
  #
146
146
  def evaluate_response(output, file, options)
147
147
  json = output.read
148
- result = {}
149
148
 
150
149
  begin
151
150
  result = MultiJson.decode(json)
151
+
152
+ if result['error']
153
+ notify_runtime_error(result, options)
154
+ else
155
+ result['file'] = file
156
+ notify_spec_result(result, options)
157
+ end
158
+
159
+ result
160
+
152
161
  rescue Exception => e
153
162
  Formatter.error("Cannot decode JSON from PhantomJS runner: #{ e.message }")
154
163
  Formatter.error('Please report an issue at: https://github.com/netzpirat/guard-jasmine/issues')
155
- Formatter.error(json)
164
+ Formatter.error("JSON response: #{ json }")
156
165
  ensure
157
166
  output.close
158
167
  end
159
-
160
- if result['error']
161
- notify_runtime_error(result, options)
162
- else
163
- result['file'] = file
164
- notify_spec_result(result, options)
165
- end
166
-
167
- result
168
168
  end
169
169
 
170
170
  # Notification when a system error happens that
@@ -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 = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 0
10
- version: 0.7.0
9
+ - 1
10
+ version: 0.7.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Kessler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-10 00:00:00 Z
18
+ date: 2011-10-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: guard