torquespec 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -80,8 +80,6 @@ module TorqueSpec
80
80
  begin
81
81
  torquespec_before_alls
82
82
  run_remotely(reporter)
83
- rescue Exception => ex
84
- fail_filtered_examples(ex, reporter)
85
83
  ensure
86
84
  torquespec_after_alls
87
85
  end
@@ -139,17 +137,44 @@ class Proc
139
137
  end
140
138
  end
141
139
 
142
- # We want any Java exceptions tossed on the server to be passed back
143
- # to the Reporter on the client, and NativeExceptions have no
144
- # allocator, hence they're not marshalable.
145
- class NativeException
146
- def _dump(*)
147
- Marshal.dump( [cause, backtrace] )
140
+ # We want exceptions tossed in the container to be passed back to the
141
+ # client, but there's no guarantee the type of Exception in the
142
+ # container will be available on the client's classpath, so we turn
143
+ # all exceptions into Exceptions.
144
+ module TorqueSpec
145
+ def self.dump(exception)
146
+ Marshal.dump( [exception.message, exception.backtrace] )
148
147
  end
149
- def self._load(str)
150
- exception, trace = Marshal.load(str)
148
+ def self.load_exception(str)
149
+ message, trace = Marshal.load(str)
150
+ exception = ::Exception.new(message)
151
151
  meta = class << exception; self; end
152
152
  meta.send(:define_method, :backtrace) { trace }
153
153
  exception
154
154
  end
155
155
  end
156
+
157
+ # For ruby exceptions...
158
+ class Exception
159
+ def _dump(*)
160
+ TorqueSpec.dump(self)
161
+ end
162
+ def self._load(str)
163
+ TorqueSpec.load_exception(str)
164
+ end
165
+ end
166
+
167
+ # And for java exceptions, too.
168
+ module Java
169
+ module JavaLang
170
+ class Exception
171
+ def _dump(*)
172
+ TorqueSpec.dump(self)
173
+ end
174
+ def self._load(str)
175
+ TorqueSpec.load_exception(str)
176
+ end
177
+ end
178
+ end
179
+ end
180
+
@@ -81,6 +81,7 @@ module TorqueSpec
81
81
 
82
82
  def post(path, params)
83
83
  req = Net::HTTP::Post.new(path)
84
+ req.content_type = "application/json"
84
85
  if (params.is_a? Hash)
85
86
  req.set_form_data( params )
86
87
  else
@@ -1,3 +1,3 @@
1
1
  module TorqueSpec
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torquespec
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 5
10
- version: 0.4.5
9
+ - 6
10
+ version: 0.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jim Crossley
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-11-07 00:00:00 -05:00
19
+ date: 2011-11-16 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency