Skip to content

Commit

Permalink
Merge pull request #324 from rsmp-nordic/fix_322
Browse files Browse the repository at this point in the history
update rsmp gem alarm ack test, fixes #318
  • Loading branch information
emiltin authored Jun 15, 2023
2 parents 9524f87 + cabf763 commit 9fbd5e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 12 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,28 @@ GEM
async
colorize (0.8.1)
concurrent-ruby (1.2.2)
console (1.16.2)
console (1.17.2)
fiber-annotation
fiber-local
diff-lcs (1.5.0)
ecma-re-validator (0.4.0)
regexp_parser (~> 2.2)
fiber-annotation (0.2.0)
fiber-local (1.0.0)
hana (1.3.7)
i18n (1.13.0)
concurrent-ruby (~> 1.0)
json_schemer (0.2.24)
json_schemer (0.2.25)
ecma-re-validator (~> 0.3)
hana (~> 1.3)
regexp_parser (~> 2.0)
simpleidn (~> 0.2)
uri_template (~> 0.7)
minitest (5.18.0)
nio4r (2.5.9)
rake (13.0.6)
regexp_parser (2.8.0)
rsmp (0.19.2)
regexp_parser (2.8.1)
rsmp (0.19.3)
async (~> 1.30.3)
async-io (~> 1.34.3)
colorize (~> 0.8.1)
Expand All @@ -54,10 +57,15 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
simpleidn (0.2.1)
unf (~> 0.1.4)
thor (1.2.2)
timers (4.3.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
uri_template (0.7.0)
yard (0.9.34)

Expand Down
8 changes: 2 additions & 6 deletions spec/site/tlc/alarm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,19 @@ def verify_timestamp alarm, duration=1.minute
num: 1,
query: {
'aCId' => alarm_code_id,
'aSp' => /Issue/i,
'aSp' => /Acknowledge/i,
'ack' => /Acknowledged/i,
'aS' => /Active/i
},
timeout: timeout
).collect!
end

m_id = RSMP::Message.make_m_id # generate a message id, that can be used to listen for repsonses
alarm = RSMP::AlarmAcknowledged.new(
'mId' => m_id,
site.send_message RSMP::AlarmAcknowledged.new(
'cId' => component_id,
'aTs' => site.clock.to_s,
'aCId' => alarm_code_id
)

site.send_message alarm, nil
messages = collect_task.wait
expect(messages).to be_an(Array)
expect(messages.first).to be_a(RSMP::Alarm)
Expand Down

0 comments on commit 9fbd5e4

Please sign in to comment.