@@ -27,18 +27,16 @@ describe('generic can', function()
27
27
28
28
it (' shoud execute read command when setup' , function ()
29
29
local messages = {
30
- { msg_id = 0x123 },
31
- { msg_id = 0x789 },
30
+ { msg_id = 123 },
31
+ { msg_id = 789 },
32
32
}
33
33
local timeout = math.random (5000 )
34
34
35
35
local peer_stub = prepare_peer_stub ()
36
36
local s = spy .on (peer_stub , ' execute_command' )
37
37
assert .is_nil (can :setup (' ' , { test_cmd = messages }, timeout ))
38
38
assert .spy (s ).was_called (1 )
39
- assert
40
- .spy (s )
41
- .was_called_with (peer_stub , ' read' , match .same ({ msg_ids = { 0x123 , 0x789 } }), { timeout = timeout })
39
+ assert .spy (s ).was_called_with (peer_stub , ' read' , { msg_ids = ' 123,789' }, { timeout = timeout })
42
40
end )
43
41
44
42
it (' should store cursor' , function ()
@@ -51,9 +49,7 @@ describe('generic can', function()
51
49
local _ , err = can :get (' test_cur' )
52
50
assert .is_nil (err )
53
51
assert .spy (s ).was_called (1 )
54
- assert
55
- .spy (s )
56
- .was_called_with (peer_stub , ' read' , match .same ({ msg_ids = {} }), { timeout = 1000 })
52
+ assert .spy (s ).was_called_with (peer_stub , ' read' , { msg_ids = ' ' }, { timeout = 1000 })
57
53
58
54
peer_stub = prepare_peer_stub ()
59
55
local s2 = spy .on (peer_stub , ' execute_command' )
@@ -62,7 +58,7 @@ describe('generic can', function()
62
58
assert .spy (s2 ).was_called (1 )
63
59
assert
64
60
.spy (s2 )
65
- .was_called_with (peer_stub , ' read' , match . same ( { cursor = cursor , msg_ids = {} }) , { timeout = 1000 })
61
+ .was_called_with (peer_stub , ' read' , { cursor = cursor , msg_ids = ' ' } , { timeout = 1000 })
66
62
end )
67
63
68
64
it (' should not get for unknow subscription' , function ()
0 commit comments