Permalink
Browse files

add spec for err['trace'] propagation

  • Loading branch information...
1 parent 110a3b8 commit fce5f7c66c833f872502baac1b1d74f5c8c4b259 @jmettraux jmettraux committed Mar 17, 2013
Showing with 21 additions and 0 deletions.
  1. +1 −0 CREDITS.txt
  2. +20 −0 spec/receiver_spec.rb
View
@@ -12,6 +12,7 @@
== CONTRIBUTORS
+* Islam Amer - https://github.com/iamer
* Jiří Kubíček - https://github.com/kubicek
* Mario Camou
* Sean Johnson - https://github.com/belucid
View
@@ -156,6 +156,26 @@ def @receiver.handle_error(e)
r['error']['message'].should == 'something missing'
end
+ it 'propagates errors passed back as hashes (+trace)' do
+
+ @dashboard.register_participant(
+ 'alf',
+ ParticipantWithError,
+ 'error' => {
+ 'class' => 'ArgumentError',
+ 'message' => 'something missing',
+ 'trace' => %w[ aaa bbb ccc ] })
+
+ wfid = @dashboard.launch(Ruote.define { alf })
+ r = @dashboard.wait_for(wfid)
+
+ r['action'].should == 'error_intercepted'
+
+ r['error']['class'].should == 'ArgumentError'
+ r['error']['message'].should == 'something missing'
+ r['error']['trace'].should == %w[ aaa bbb ccc ]
+ end
+
it 'propagates errors passed back as whatever' do
@dashboard.register_participant(

0 comments on commit fce5f7c

Please sign in to comment.