switest 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46d12432ffab240a974d72b3dd40c644881db795afdf01f0907837bf6a07f749
4
- data.tar.gz: 599397a725f50b57b243a42a451b8dea72497fbc86fd8dd2908096627a22e097
3
+ metadata.gz: 3c144f6162bbe043cadc3c2743542ff52b0b9c2ef7d9ac2b694fe88cd1db1ebb
4
+ data.tar.gz: f99e71cbfd40ae2baf0ad5eab7b8864a66f01c611e612d843a7482fa642c3d6d
5
5
  SHA512:
6
- metadata.gz: a409ab5e4948ac6bd38518f3a5bcbbaac61e8154ce6e162916f0ae0fa66ab819b68f0f3cf073127703ebb38741d616c8437f3a1a3cebad376d6d240b188eb6cd
7
- data.tar.gz: eda147e356709c794896b2e274b2bf7e74f15dc42c422e5898255ec8c62c112deb5f8249cded86b056257a91befc1f65a498ff76eb680dfa6584b0631a871e01
6
+ metadata.gz: 4185e0b448059955f50cd699d095c12666197daf13efa83a203aebfd2d0a3515e287bc7d0334c651f4a967f89181ae0252030f00a07d2f0e354ac3989a6e13ef
7
+ data.tar.gz: 661109e09e38b8fbed7eeb32ceb7c664046d1fda387d77b85f832d2fe172d8cc0dc47882d3df00bb76351082e32490a66e781ace96d8f50e471048e32463988d
data/README.md CHANGED
@@ -168,11 +168,13 @@ agent.end_reason # e.g. "NORMAL_CLEARING"
168
168
  `Switest::Scenario` provides these assertions:
169
169
 
170
170
  ```ruby
171
- assert_call(agent, timeout: 5) # Agent receives a call
172
- assert_no_call(agent, timeout: 2) # Agent does NOT receive a call
173
- assert_hungup(agent, timeout: 5) # Call has ended
174
- assert_not_hungup(agent, timeout: 2) # Call is still active
175
- assert_dtmf(agent, "123", timeout: 5) # Agent receives expected DTMF digits
171
+ assert_call(agent, timeout: 5) # Agent receives a call
172
+ assert_no_call(agent, timeout: 2) # Agent does NOT receive a call
173
+ assert_answered(agent, timeout: 5) # Call has been answered
174
+ assert_bridged(agent, timeout: 5) # Call has been bridged
175
+ assert_hungup(agent, timeout: 5) # Call has ended
176
+ assert_not_hungup(agent, timeout: 2) # Call is still active
177
+ assert_dtmf(agent, "123", timeout: 5) # Agent receives expected DTMF digits
176
178
  assert_dtmf(agent, "123") { other.send_dtmf("123") } # With block: flushes stale DTMF first
177
179
  ```
178
180
 
@@ -49,6 +49,18 @@ module Switest
49
49
  refute agent.call?, "Expected agent to not have received a call"
50
50
  end
51
51
 
52
+ def assert_answered(agent, timeout: 5)
53
+ assert agent.call?, "Agent has no call"
54
+ success = agent.wait_for_answer(timeout: timeout)
55
+ assert success, "Expected call to be answered within #{timeout} seconds"
56
+ end
57
+
58
+ def assert_bridged(agent, timeout: 5)
59
+ assert agent.call?, "Agent has no call"
60
+ success = agent.wait_for_bridge(timeout: timeout)
61
+ assert success, "Expected call to be bridged within #{timeout} seconds"
62
+ end
63
+
52
64
  def assert_hungup(agent, timeout: 5)
53
65
  assert agent.call?, "Agent has no call"
54
66
  success = agent.wait_for_end(timeout: timeout)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switest
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Relatel A/S