wamp_client 0.1.2 → 0.1.3

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: 5735e4d3344f243325a9226289448ea18b3cf27d
4
- data.tar.gz: cbd5aa1d9ae5d059d8ebbc655a6fd3b80ff17c32
3
+ metadata.gz: cc93c0d05bcbfb3733b1f40ce71f6c318467d6fd
4
+ data.tar.gz: d5219fd104bc66d1a88f7b388f69eee2c8b4587d
5
5
  SHA512:
6
- metadata.gz: 15aa5f6f522da9cc50c336078d2d93d0190bbe07449177499f77df36464c2a14d80a359e6190ebaa6cb762bceecd2080677d0c51501d44f5d952ceb94e297b11
7
- data.tar.gz: 135d51166dfb40468ebb8eb603a5707cb9cb02d1b5685378499849e8b2d8cb167d87031956e1b367cf679ba0bde03e18f4b6c420efac9bf2178586fe0fdea6ac
6
+ metadata.gz: f1033d200d29053a18f5793cc7d72d0017777c5380dc304f6986f344deb4fb9bbdee9e1e812f68c269e26c075abbdc94b5bf23b00cd0bf2aba6d966fddc4f181
7
+ data.tar.gz: 7eee35514938b9b2e814c989dc10132650a3bf5755ec19504a9b1e5edbaa2dd2631ababf8323be8f6199fbed72d77a7120449759a5b50b5cb3129c3bf7d13fc1
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ mkmf.log
15
15
  .idea
16
16
  *.tmp
17
17
  .DS_Store
18
+ .idea/
data/README.md CHANGED
@@ -10,6 +10,10 @@ Please use [wamp_rails](https://github.com/ericchapman/ruby_wamp_rails) to integ
10
10
 
11
11
  ## Revision History
12
12
 
13
+ - v0.1.3:
14
+ - Improved logging
15
+ - Minor code cleanup
16
+ - Added including backtrace when unknown error occurs in "call"
13
17
  - v0.1.2:
14
18
  - Updated logging to use the standard Ruby logger
15
19
  - v0.1.1:
@@ -76,7 +80,6 @@ require 'wamp/client'
76
80
  options = {
77
81
  uri: 'ws://127.0.0.1:8080/ws',
78
82
  realm: 'realm1',
79
- verbose: true
80
83
  }
81
84
  connection = Wamp::Client::Connection.new(options)
82
85
 
@@ -42,58 +42,7 @@ module Wamp
42
42
 
43
43
  # @param params [Array]
44
44
  def self.parse(params)
45
- object = nil
46
- if params[0] == Types::HELLO
47
- object = Wamp::Client::Message::Hello.parse(params)
48
- elsif params[0] == Types::WELCOME
49
- object = Wamp::Client::Message::Welcome.parse(params)
50
- elsif params[0] == Types::ABORT
51
- object = Wamp::Client::Message::Abort.parse(params)
52
- elsif params[0] == Types::CHALLENGE
53
- object = Wamp::Client::Message::Challenge.parse(params)
54
- elsif params[0] == Types::AUTHENTICATE
55
- object = Wamp::Client::Message::Authenticate.parse(params)
56
- elsif params[0] == Types::GOODBYE
57
- object = Wamp::Client::Message::Goodbye.parse(params)
58
- elsif params[0] == Types::ERROR
59
- object = Wamp::Client::Message::Error.parse(params)
60
- elsif params[0] == Types::PUBLISH
61
- object = Wamp::Client::Message::Publish.parse(params)
62
- elsif params[0] == Types::PUBLISHED
63
- object = Wamp::Client::Message::Published.parse(params)
64
- elsif params[0] == Types::SUBSCRIBE
65
- object = Wamp::Client::Message::Subscribe.parse(params)
66
- elsif params[0] == Types::SUBSCRIBED
67
- object = Wamp::Client::Message::Subscribed.parse(params)
68
- elsif params[0] == Types::UNSUBSCRIBE
69
- object = Wamp::Client::Message::Unsubscribe.parse(params)
70
- elsif params[0] == Types::UNSUBSCRIBED
71
- object = Wamp::Client::Message::Unsubscribed.parse(params)
72
- elsif params[0] == Types::EVENT
73
- object = Wamp::Client::Message::Event.parse(params)
74
- elsif params[0] == Types::CALL
75
- object = Wamp::Client::Message::Call.parse(params)
76
- elsif params[0] == Types::CANCEL
77
- object = Wamp::Client::Message::Cancel.parse(params)
78
- elsif params[0] == Types::RESULT
79
- object = Wamp::Client::Message::Result.parse(params)
80
- elsif params[0] == Types::REGISTER
81
- object = Wamp::Client::Message::Register.parse(params)
82
- elsif params[0] == Types::REGISTERED
83
- object = Wamp::Client::Message::Registered.parse(params)
84
- elsif params[0] == Types::UNREGISTER
85
- object = Wamp::Client::Message::Unregister.parse(params)
86
- elsif params[0] == Types::UNREGISTERED
87
- object = Wamp::Client::Message::Unregistered.parse(params)
88
- elsif params[0] == Types::INVOCATION
89
- object = Wamp::Client::Message::Invocation.parse(params)
90
- elsif params[0] == Types::INTERRUPT
91
- object = Wamp::Client::Message::Interrupt.parse(params)
92
- elsif params[0] == Types::YIELD
93
- object = Wamp::Client::Message::Yield.parse(params)
94
- end
95
-
96
- object
45
+ nil
97
46
  end
98
47
  end
99
48
 
@@ -1317,6 +1266,39 @@ module Wamp
1317
1266
 
1318
1267
  end
1319
1268
 
1269
+ TYPE_LOOKUP = {
1270
+ Types::HELLO => Hello,
1271
+ Types::WELCOME => Welcome,
1272
+ Types::ABORT => Abort,
1273
+ Types::CHALLENGE => Challenge,
1274
+ Types::AUTHENTICATE => Authenticate,
1275
+ Types::GOODBYE => Goodbye,
1276
+ Types::ERROR => Error,
1277
+ Types::PUBLISH => Publish,
1278
+ Types::PUBLISHED => Published,
1279
+ Types::SUBSCRIBE => Subscribe,
1280
+ Types::SUBSCRIBED => Subscribed,
1281
+ Types::UNSUBSCRIBE => Unsubscribe,
1282
+ Types::UNSUBSCRIBED => Unsubscribed,
1283
+ Types::EVENT => Event,
1284
+ Types::CALL => Call,
1285
+ Types::CANCEL => Cancel,
1286
+ Types::RESULT => Result,
1287
+ Types::REGISTER => Register,
1288
+ Types::REGISTERED => Registered,
1289
+ Types::UNREGISTER => Unregister,
1290
+ Types::UNREGISTERED => Unregistered,
1291
+ Types::INVOCATION => Invocation,
1292
+ Types::INTERRUPT => Interrupt,
1293
+ Types::YIELD => Yield,
1294
+ }
1295
+
1296
+ # @param params [Array]
1297
+ def self.parse(params)
1298
+ klass = TYPE_LOOKUP[params[0]]
1299
+ klass ? klass.parse(params.clone) : nil
1300
+ end
1301
+
1320
1302
  end
1321
1303
  end
1322
1304
  end
@@ -71,6 +71,27 @@ module Wamp
71
71
  }
72
72
  }
73
73
 
74
+ HANDLER_LOOKUP = {
75
+ # Error Responses
76
+ Message::Types::SUBSCRIBE => -> s,m { s._process_SUBSCRIBE_error(m) },
77
+ Message::Types::UNSUBSCRIBE => -> s,m { s._process_UNSUBSCRIBE_error(m) },
78
+ Message::Types::PUBLISH => -> s,m { s._process_PUBLISH_error(m) },
79
+ Message::Types::REGISTER => -> s,m { s._process_REGISTER_error(m) },
80
+ Message::Types::UNREGISTER => -> s,m { s._process_UNREGISTER_error(m) },
81
+ Message::Types::CALL => -> s,m { s._process_CALL_error(m) },
82
+
83
+ # Result Responses
84
+ Message::Types::SUBSCRIBED => -> s,m { s._process_SUBSCRIBED(m) },
85
+ Message::Types::UNSUBSCRIBED => -> s,m { s._process_UNSUBSCRIBED(m) },
86
+ Message::Types::PUBLISHED => -> s,m { s._process_PUBLISHED(m) },
87
+ Message::Types::EVENT => -> s,m { s._process_EVENT(m) },
88
+ Message::Types::REGISTERED => -> s,m { s._process_REGISTERED(m) },
89
+ Message::Types::UNREGISTERED => -> s,m { s._process_UNREGISTERED(m) },
90
+ Message::Types::INVOCATION => -> s,m { s._process_INVOCATION(m) },
91
+ Message::Types::INTERRUPT => -> s,m { s._process_INTERRUPT(m) },
92
+ Message::Types::RESULT => -> s,m { s._process_RESULT(m) },
93
+ }
94
+
74
95
  class CallResult
75
96
  attr_accessor :args, :kwargs
76
97
 
@@ -293,7 +314,10 @@ module Wamp
293
314
  # Sends a message
294
315
  # @param msg [Wamp::Client::Message::Base]
295
316
  def _send_message(msg)
317
+ # Log the message
296
318
  logger.debug("#{self.class.name} TX: #{msg.to_s}")
319
+
320
+ # Send it to the transport
297
321
  self.transport.send_message(msg.payload)
298
322
  end
299
323
 
@@ -301,20 +325,33 @@ module Wamp
301
325
  # @param msg [Array]
302
326
  def _receive_message(msg)
303
327
 
304
- message = Wamp::Client::Message::Base.parse(msg)
328
+ # Print the raw message
329
+ logger.debug("#{self.class.name} RX(raw): #{msg.to_s}")
305
330
 
331
+ # Parse the WAMP message
332
+ message = Wamp::Client::Message.parse(msg)
333
+
334
+ # Print the parsed WAMP message
306
335
  logger.debug("#{self.class.name} RX: #{message.to_s}")
307
- logger.debug("#{self.class.name} RX(non-samp): #{msg.to_s}")
308
336
 
309
337
  # WAMP Session is not open
310
338
  if self.id.nil?
311
339
 
312
340
  # Parse the welcome message
313
341
  if message.is_a? Wamp::Client::Message::Welcome
342
+ # Get the session ID
314
343
  self.id = message.session
344
+
345
+ # Log joining the session
346
+ logger.info("#{self.class.name} joined session with realm '#{message.details[:realm]}'")
347
+
348
+ # Call the callback if it is set
315
349
  @on_join.call(message.details) unless @on_join.nil?
316
350
  elsif message.is_a? Wamp::Client::Message::Challenge
351
+ # Log challenge received
352
+ logger.debug("#{self.class.name} auth challenge '#{message.authmethod}', extra: #{message.extra}")
317
353
 
354
+ # Call the callback if set
318
355
  if @on_challenge
319
356
  signature, extra = @on_challenge.call(message.authmethod, message.extra)
320
357
  else
@@ -329,6 +366,10 @@ module Wamp
329
366
  self._send_message(authenticate)
330
367
 
331
368
  elsif message.is_a? Wamp::Client::Message::Abort
369
+ # Log leaving the session
370
+ logger.info("#{self.class.name} left session '#{message.reason}'")
371
+
372
+ # Call the callback if it is set
332
373
  @on_leave.call(message.reason, message.details) unless @on_leave.nil?
333
374
  end
334
375
 
@@ -352,49 +393,15 @@ module Wamp
352
393
 
353
394
  else
354
395
 
355
- # Process Errors
356
- if message.is_a? Wamp::Client::Message::Error
357
- if message.request_type == Wamp::Client::Message::Types::SUBSCRIBE
358
- self._process_SUBSCRIBE_error(message)
359
- elsif message.request_type == Wamp::Client::Message::Types::UNSUBSCRIBE
360
- self._process_UNSUBSCRIBE_error(message)
361
- elsif message.request_type == Wamp::Client::Message::Types::PUBLISH
362
- self._process_PUBLISH_error(message)
363
- elsif message.request_type == Wamp::Client::Message::Types::REGISTER
364
- self._process_REGISTER_error(message)
365
- elsif message.request_type == Wamp::Client::Message::Types::UNREGISTER
366
- self._process_UNREGISTER_error(message)
367
- elsif message.request_type == Wamp::Client::Message::Types::CALL
368
- self._process_CALL_error(message)
369
- else
370
- # TODO: Some Error?? Not Implemented yet
371
- end
396
+ # Else this is a normal message. Lookup the handler and call it
397
+ type = message.is_a?(Message::Error) ? message.request_type : message.class.type
398
+ handler = HANDLER_LOOKUP[type]
372
399
 
373
- # Process Messages
400
+ if handler != nil
401
+ handler.call(self, message)
374
402
  else
375
- if message.is_a? Wamp::Client::Message::Subscribed
376
- self._process_SUBSCRIBED(message)
377
- elsif message.is_a? Wamp::Client::Message::Unsubscribed
378
- self._process_UNSUBSCRIBED(message)
379
- elsif message.is_a? Wamp::Client::Message::Published
380
- self._process_PUBLISHED(message)
381
- elsif message.is_a? Wamp::Client::Message::Event
382
- self._process_EVENT(message)
383
- elsif message.is_a? Wamp::Client::Message::Registered
384
- self._process_REGISTERED(message)
385
- elsif message.is_a? Wamp::Client::Message::Unregistered
386
- self._process_UNREGISTERED(message)
387
- elsif message.is_a? Wamp::Client::Message::Invocation
388
- self._process_INVOCATION(message)
389
- elsif message.is_a? Wamp::Client::Message::Interrupt
390
- self._process_INTERRUPT(message)
391
- elsif message.is_a? Wamp::Client::Message::Result
392
- self._process_RESULT(message)
393
- else
394
- # TODO: Some Error?? Not Implemented yet
395
- end
403
+ logger.error("#{self.class.name} unknown message type '#{type}'")
396
404
  end
397
-
398
405
  end
399
406
  end
400
407
 
@@ -697,7 +704,8 @@ module Wamp
697
704
  if error.nil?
698
705
  error = CallError.new('wamp.error.runtime')
699
706
  elsif not error.is_a?(CallError)
700
- error = CallError.new('wamp.error.runtime', [error.to_s])
707
+ backtrace = error.is_a?(Exception) ? error.backtrace : nil
708
+ error = CallError.new('wamp.error.runtime', [error.to_s], { backtrace: backtrace })
701
709
  end
702
710
 
703
711
  error_msg = Wamp::Client::Message::Error.new(Wamp::Client::Message::Types::INVOCATION, request, {}, error.error, error.args, error.kwargs)
@@ -27,6 +27,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
27
 
28
28
  module Wamp
29
29
  module Client
30
- VERSION = '0.1.2'
30
+ VERSION = '0.1.3'
31
31
  end
32
32
  end
@@ -65,22 +65,13 @@ message_type_lookup = {
65
65
 
66
66
  message_type_define = ''
67
67
  message_lookup_define = ''
68
- count = 0
69
68
  message_type_lookup.each do |name, value|
70
69
 
71
70
  # Generate the defines
72
71
  message_type_define += " #{name} = #{value}\n"
73
72
 
74
73
  # Generate the lookup
75
- if count == 0
76
- message_lookup_define += ' if'
77
- else
78
- message_lookup_define += ' elsif'
79
- end
80
- message_lookup_define += " params[0] == Types::#{name}\n"
81
- message_lookup_define += " object = Wamp::Client::Message::#{name.downcase.capitalize}.parse(params)\n"
82
-
83
- count += 1
74
+ message_lookup_define += " Types::#{name} => #{name.downcase.capitalize},\n"
84
75
  end
85
76
 
86
77
  source_file_header = "require 'wamp/client/check'
@@ -103,15 +94,21 @@ module Wamp
103
94
 
104
95
  # @param params [Array]
105
96
  def self.parse(params)
106
- object = nil
107
- #{message_lookup_define} end
108
-
109
- object
97
+ nil
110
98
  end
111
99
  end
112
100
  "
113
101
 
114
102
  source_file_footer = "
103
+ TYPE_LOOKUP = {
104
+ #{message_lookup_define} }
105
+
106
+ # @param params [Array]
107
+ def self.parse(params)
108
+ klass = TYPE_LOOKUP[params[0]]
109
+ klass ? klass.parse(params.clone) : nil
110
+ end
111
+
115
112
  end
116
113
  end
117
114
  end
@@ -501,7 +498,7 @@ messages.each do |message|
501
498
  # Generate Global Parser Test
502
499
  test_file += "\n it 'globally parses the message and creates an object' do\n"
503
500
  test_file += " params = [#{message_type_lookup[message[:name].upcase]},#{value_array.join(',')}]\n"
504
- test_file += " object = Wamp::Client::Message::Base.parse(params)\n\n"
501
+ test_file += " object = Wamp::Client::Message.parse(params)\n\n"
505
502
  params.each do |param|
506
503
  if param[:required]
507
504
  test_file += " expect(object.#{param[:name]}).to eq(#{value_from_type(param[:type])})\n"
@@ -26,7 +26,7 @@ describe Wamp::Client::Message do
26
26
 
27
27
  it 'globally parses the message and creates an object' do
28
28
  params = [1,'string',{ test: 1 }]
29
- object = Wamp::Client::Message::Base.parse(params)
29
+ object = Wamp::Client::Message.parse(params)
30
30
 
31
31
  expect(object.realm).to eq('string')
32
32
  expect(object.details).to eq({ test: 1 })
@@ -68,7 +68,7 @@ describe Wamp::Client::Message do
68
68
 
69
69
  it 'globally parses the message and creates an object' do
70
70
  params = [2,123,{ test: 1 }]
71
- object = Wamp::Client::Message::Base.parse(params)
71
+ object = Wamp::Client::Message.parse(params)
72
72
 
73
73
  expect(object.session).to eq(123)
74
74
  expect(object.details).to eq({ test: 1 })
@@ -110,7 +110,7 @@ describe Wamp::Client::Message do
110
110
 
111
111
  it 'globally parses the message and creates an object' do
112
112
  params = [3,{ test: 1 },'string']
113
- object = Wamp::Client::Message::Base.parse(params)
113
+ object = Wamp::Client::Message.parse(params)
114
114
 
115
115
  expect(object.details).to eq({ test: 1 })
116
116
  expect(object.reason).to eq('string')
@@ -152,7 +152,7 @@ describe Wamp::Client::Message do
152
152
 
153
153
  it 'globally parses the message and creates an object' do
154
154
  params = [6,{ test: 1 },'string']
155
- object = Wamp::Client::Message::Base.parse(params)
155
+ object = Wamp::Client::Message.parse(params)
156
156
 
157
157
  expect(object.details).to eq({ test: 1 })
158
158
  expect(object.reason).to eq('string')
@@ -198,7 +198,7 @@ describe Wamp::Client::Message do
198
198
 
199
199
  it 'globally parses the message and creates an object' do
200
200
  params = [8,123,123,{ test: 1 },'string']
201
- object = Wamp::Client::Message::Base.parse(params)
201
+ object = Wamp::Client::Message.parse(params)
202
202
 
203
203
  expect(object.request_type).to eq(123)
204
204
  expect(object.request_request).to eq(123)
@@ -342,7 +342,7 @@ describe Wamp::Client::Message do
342
342
 
343
343
  it 'globally parses the message and creates an object' do
344
344
  params = [16,123,{ test: 1 },'string']
345
- object = Wamp::Client::Message::Base.parse(params)
345
+ object = Wamp::Client::Message.parse(params)
346
346
 
347
347
  expect(object.request).to eq(123)
348
348
  expect(object.options).to eq({ test: 1 })
@@ -479,7 +479,7 @@ describe Wamp::Client::Message do
479
479
 
480
480
  it 'globally parses the message and creates an object' do
481
481
  params = [17,123,123]
482
- object = Wamp::Client::Message::Base.parse(params)
482
+ object = Wamp::Client::Message.parse(params)
483
483
 
484
484
  expect(object.publish_request).to eq(123)
485
485
  expect(object.publication).to eq(123)
@@ -523,7 +523,7 @@ describe Wamp::Client::Message do
523
523
 
524
524
  it 'globally parses the message and creates an object' do
525
525
  params = [32,123,{ test: 1 },'string']
526
- object = Wamp::Client::Message::Base.parse(params)
526
+ object = Wamp::Client::Message.parse(params)
527
527
 
528
528
  expect(object.request).to eq(123)
529
529
  expect(object.options).to eq({ test: 1 })
@@ -567,7 +567,7 @@ describe Wamp::Client::Message do
567
567
 
568
568
  it 'globally parses the message and creates an object' do
569
569
  params = [33,123,123]
570
- object = Wamp::Client::Message::Base.parse(params)
570
+ object = Wamp::Client::Message.parse(params)
571
571
 
572
572
  expect(object.subscribe_request).to eq(123)
573
573
  expect(object.subscription).to eq(123)
@@ -609,7 +609,7 @@ describe Wamp::Client::Message do
609
609
 
610
610
  it 'globally parses the message and creates an object' do
611
611
  params = [34,123,123]
612
- object = Wamp::Client::Message::Base.parse(params)
612
+ object = Wamp::Client::Message.parse(params)
613
613
 
614
614
  expect(object.request).to eq(123)
615
615
  expect(object.subscribed_subscription).to eq(123)
@@ -649,7 +649,7 @@ describe Wamp::Client::Message do
649
649
 
650
650
  it 'globally parses the message and creates an object' do
651
651
  params = [35,123]
652
- object = Wamp::Client::Message::Base.parse(params)
652
+ object = Wamp::Client::Message.parse(params)
653
653
 
654
654
  expect(object.unsubscribe_request).to eq(123)
655
655
  expect(object.is_a?(Wamp::Client::Message::Unsubscribed)).to eq(true)
@@ -691,7 +691,7 @@ describe Wamp::Client::Message do
691
691
 
692
692
  it 'globally parses the message and creates an object' do
693
693
  params = [36,123,123,{ test: 1 }]
694
- object = Wamp::Client::Message::Base.parse(params)
694
+ object = Wamp::Client::Message.parse(params)
695
695
 
696
696
  expect(object.subscribed_subscription).to eq(123)
697
697
  expect(object.published_publication).to eq(123)
@@ -830,7 +830,7 @@ describe Wamp::Client::Message do
830
830
 
831
831
  it 'globally parses the message and creates an object' do
832
832
  params = [48,123,{ test: 1 },'string']
833
- object = Wamp::Client::Message::Base.parse(params)
833
+ object = Wamp::Client::Message.parse(params)
834
834
 
835
835
  expect(object.request).to eq(123)
836
836
  expect(object.options).to eq({ test: 1 })
@@ -967,7 +967,7 @@ describe Wamp::Client::Message do
967
967
 
968
968
  it 'globally parses the message and creates an object' do
969
969
  params = [50,123,{ test: 1 }]
970
- object = Wamp::Client::Message::Base.parse(params)
970
+ object = Wamp::Client::Message.parse(params)
971
971
 
972
972
  expect(object.call_request).to eq(123)
973
973
  expect(object.details).to eq({ test: 1 })
@@ -1101,7 +1101,7 @@ describe Wamp::Client::Message do
1101
1101
 
1102
1102
  it 'globally parses the message and creates an object' do
1103
1103
  params = [64,123,{ test: 1 },'string']
1104
- object = Wamp::Client::Message::Base.parse(params)
1104
+ object = Wamp::Client::Message.parse(params)
1105
1105
 
1106
1106
  expect(object.request).to eq(123)
1107
1107
  expect(object.options).to eq({ test: 1 })
@@ -1145,7 +1145,7 @@ describe Wamp::Client::Message do
1145
1145
 
1146
1146
  it 'globally parses the message and creates an object' do
1147
1147
  params = [65,123,123]
1148
- object = Wamp::Client::Message::Base.parse(params)
1148
+ object = Wamp::Client::Message.parse(params)
1149
1149
 
1150
1150
  expect(object.register_request).to eq(123)
1151
1151
  expect(object.registration).to eq(123)
@@ -1187,7 +1187,7 @@ describe Wamp::Client::Message do
1187
1187
 
1188
1188
  it 'globally parses the message and creates an object' do
1189
1189
  params = [66,123,123]
1190
- object = Wamp::Client::Message::Base.parse(params)
1190
+ object = Wamp::Client::Message.parse(params)
1191
1191
 
1192
1192
  expect(object.request).to eq(123)
1193
1193
  expect(object.registered_registration).to eq(123)
@@ -1227,7 +1227,7 @@ describe Wamp::Client::Message do
1227
1227
 
1228
1228
  it 'globally parses the message and creates an object' do
1229
1229
  params = [67,123]
1230
- object = Wamp::Client::Message::Base.parse(params)
1230
+ object = Wamp::Client::Message.parse(params)
1231
1231
 
1232
1232
  expect(object.unregister_request).to eq(123)
1233
1233
  expect(object.is_a?(Wamp::Client::Message::Unregistered)).to eq(true)
@@ -1269,7 +1269,7 @@ describe Wamp::Client::Message do
1269
1269
 
1270
1270
  it 'globally parses the message and creates an object' do
1271
1271
  params = [68,123,123,{ test: 1 }]
1272
- object = Wamp::Client::Message::Base.parse(params)
1272
+ object = Wamp::Client::Message.parse(params)
1273
1273
 
1274
1274
  expect(object.request).to eq(123)
1275
1275
  expect(object.registered_registration).to eq(123)
@@ -1406,7 +1406,7 @@ describe Wamp::Client::Message do
1406
1406
 
1407
1407
  it 'globally parses the message and creates an object' do
1408
1408
  params = [70,123,{ test: 1 }]
1409
- object = Wamp::Client::Message::Base.parse(params)
1409
+ object = Wamp::Client::Message.parse(params)
1410
1410
 
1411
1411
  expect(object.invocation_request).to eq(123)
1412
1412
  expect(object.options).to eq({ test: 1 })
@@ -1538,7 +1538,7 @@ describe Wamp::Client::Message do
1538
1538
 
1539
1539
  it 'globally parses the message and creates an object' do
1540
1540
  params = [4,'string',{ test: 1 }]
1541
- object = Wamp::Client::Message::Base.parse(params)
1541
+ object = Wamp::Client::Message.parse(params)
1542
1542
 
1543
1543
  expect(object.authmethod).to eq('string')
1544
1544
  expect(object.extra).to eq({ test: 1 })
@@ -1580,7 +1580,7 @@ describe Wamp::Client::Message do
1580
1580
 
1581
1581
  it 'globally parses the message and creates an object' do
1582
1582
  params = [5,'string',{ test: 1 }]
1583
- object = Wamp::Client::Message::Base.parse(params)
1583
+ object = Wamp::Client::Message.parse(params)
1584
1584
 
1585
1585
  expect(object.signature).to eq('string')
1586
1586
  expect(object.extra).to eq({ test: 1 })
@@ -1622,7 +1622,7 @@ describe Wamp::Client::Message do
1622
1622
 
1623
1623
  it 'globally parses the message and creates an object' do
1624
1624
  params = [49,123,{ test: 1 }]
1625
- object = Wamp::Client::Message::Base.parse(params)
1625
+ object = Wamp::Client::Message.parse(params)
1626
1626
 
1627
1627
  expect(object.call_request).to eq(123)
1628
1628
  expect(object.options).to eq({ test: 1 })
@@ -1664,7 +1664,7 @@ describe Wamp::Client::Message do
1664
1664
 
1665
1665
  it 'globally parses the message and creates an object' do
1666
1666
  params = [69,123,{ test: 1 }]
1667
- object = Wamp::Client::Message::Base.parse(params)
1667
+ object = Wamp::Client::Message.parse(params)
1668
1668
 
1669
1669
  expect(object.invocation_request).to eq(123)
1670
1670
  expect(object.options).to eq({ test: 1 })
@@ -689,6 +689,7 @@ describe Wamp::Client::Session do
689
689
  expect(transport.messages[0][3]).to eq({})
690
690
  expect(transport.messages[0][4]).to eq('wamp.error.runtime')
691
691
  expect(transport.messages[0][5]).to eq(['error'])
692
+ expect(transport.messages[0][6][:backtrace]).not_to be_nil
692
693
 
693
694
  end
694
695
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wamp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Chapman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-03 00:00:00.000000000 Z
11
+ date: 2018-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler