aws-flow 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/aws/decider/data_converter.rb +5 -1
- data/lib/aws/decider/version.rb +1 -1
- data/test/aws/decider_spec.rb +28 -15
- metadata +1 -1
@@ -29,7 +29,11 @@ module AWS
|
|
29
29
|
return nil if source.nil?
|
30
30
|
output = YAML.load source
|
31
31
|
if output.is_a? Exception
|
32
|
-
|
32
|
+
documents = YAML.load_stream(source)
|
33
|
+
if YAML::ENGINE.yamler == 'syck'
|
34
|
+
documents = documents.documents
|
35
|
+
end
|
36
|
+
backtrace = documents.find {|x| ! x.is_a? Exception}
|
33
37
|
output.set_backtrace(backtrace.to_a)
|
34
38
|
end
|
35
39
|
output
|
data/lib/aws/decider/version.rb
CHANGED
data/test/aws/decider_spec.rb
CHANGED
@@ -303,23 +303,36 @@ describe AsyncDecider do
|
|
303
303
|
end
|
304
304
|
describe YAMLDataConverter do
|
305
305
|
let(:converter) {YAMLDataConverter.new}
|
306
|
-
|
307
|
-
{
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
306
|
+
%w{syck psych}.each do |engine|
|
307
|
+
describe "ensures that x == load(dump(x)) is true using #{engine}" do
|
308
|
+
before :all do
|
309
|
+
YAML::ENGINE.yamler = engine
|
310
|
+
end
|
311
|
+
|
312
|
+
{
|
313
|
+
Fixnum => 5,
|
314
|
+
String => "Hello World",
|
315
|
+
Hash => {:test => "good"},
|
316
|
+
Array => ["Hello", "World", 5],
|
317
|
+
Symbol => :test,
|
318
|
+
NilClass => nil,
|
319
|
+
}.each_pair do |klass, exemplar|
|
320
|
+
it "tests #{klass}" do
|
321
|
+
1.upto(10).each do |i|
|
322
|
+
converted_exemplar = exemplar
|
323
|
+
i.times {converted_exemplar = converter.dump converted_exemplar}
|
324
|
+
i.times {converted_exemplar = converter.load converted_exemplar}
|
325
|
+
converted_exemplar.should == exemplar
|
326
|
+
end
|
321
327
|
end
|
322
328
|
end
|
329
|
+
|
330
|
+
it 'loads exception backtraces correctly' do
|
331
|
+
exemplar = Exception.new('exception')
|
332
|
+
exemplar.set_backtrace(caller)
|
333
|
+
converted_exemplar = converter.load(converter.dump(exemplar))
|
334
|
+
converted_exemplar.should == exemplar
|
335
|
+
end
|
323
336
|
end
|
324
337
|
end
|
325
338
|
end
|