punchblock 2.5.2 → 2.5.3
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 +4 -4
- data/.hound.yml +2 -0
- data/CHANGELOG.md +6 -0
- data/README.markdown +2 -1
- data/lib/punchblock/translator/asterisk/call.rb +3 -3
- data/lib/punchblock/translator/asterisk/component/mrcp_recog_prompt.rb +15 -9
- data/lib/punchblock/translator/asterisk/component/output.rb +8 -1
- data/lib/punchblock/translator/input_component.rb +2 -0
- data/lib/punchblock/version.rb +1 -1
- data/punchblock.gemspec +1 -1
- data/spec/punchblock/client/component_registry_spec.rb +3 -3
- data/spec/punchblock/client_spec.rb +22 -15
- data/spec/punchblock/command/accept_spec.rb +17 -7
- data/spec/punchblock/command/answer_spec.rb +19 -9
- data/spec/punchblock/command/dial_spec.rb +76 -27
- data/spec/punchblock/command/hangup_spec.rb +17 -7
- data/spec/punchblock/command/join_spec.rb +78 -24
- data/spec/punchblock/command/mute_spec.rb +3 -3
- data/spec/punchblock/command/redirect_spec.rb +33 -12
- data/spec/punchblock/command/reject_spec.rb +41 -14
- data/spec/punchblock/command/unjoin_spec.rb +29 -12
- data/spec/punchblock/command/unmute_spec.rb +3 -3
- data/spec/punchblock/command_node_spec.rb +43 -20
- data/spec/punchblock/component/asterisk/agi/command_spec.rb +52 -12
- data/spec/punchblock/component/asterisk/ami/action_spec.rb +69 -21
- data/spec/punchblock/component/component_node_spec.rb +12 -12
- data/spec/punchblock/component/input_spec.rb +304 -87
- data/spec/punchblock/component/output_spec.rb +434 -173
- data/spec/punchblock/component/prompt_spec.rb +63 -20
- data/spec/punchblock/component/receive_fax_spec.rb +43 -14
- data/spec/punchblock/component/record_spec.rb +215 -71
- data/spec/punchblock/component/send_fax_spec.rb +54 -15
- data/spec/punchblock/connection/asterisk_spec.rb +34 -24
- data/spec/punchblock/connection/freeswitch_spec.rb +9 -9
- data/spec/punchblock/connection/xmpp_spec.rb +92 -83
- data/spec/punchblock/event/answered_spec.rb +14 -4
- data/spec/punchblock/event/asterisk/ami/event_spec.rb +34 -12
- data/spec/punchblock/event/complete_spec.rb +36 -16
- data/spec/punchblock/event/dtmf_spec.rb +9 -3
- data/spec/punchblock/event/end_spec.rb +43 -10
- data/spec/punchblock/event/input_timers_started_spec.rb +1 -1
- data/spec/punchblock/event/joined_spec.rb +29 -7
- data/spec/punchblock/event/offer_spec.rb +41 -10
- data/spec/punchblock/event/ringing_spec.rb +14 -4
- data/spec/punchblock/event/started_speaking_spec.rb +9 -3
- data/spec/punchblock/event/stopped_speaking_spec.rb +9 -3
- data/spec/punchblock/event/unjoined_spec.rb +24 -6
- data/spec/punchblock/protocol_error_spec.rb +16 -13
- data/spec/punchblock/ref_spec.rb +90 -26
- data/spec/punchblock/translator/asterisk/call_spec.rb +176 -161
- data/spec/punchblock/translator/asterisk/component/asterisk/agi_command_spec.rb +18 -18
- data/spec/punchblock/translator/asterisk/component/asterisk/ami_action_spec.rb +9 -9
- data/spec/punchblock/translator/asterisk/component/composed_prompt_spec.rb +14 -14
- data/spec/punchblock/translator/asterisk/component/input_spec.rb +57 -36
- data/spec/punchblock/translator/asterisk/component/mrcp_native_prompt_spec.rb +50 -50
- data/spec/punchblock/translator/asterisk/component/mrcp_prompt_spec.rb +59 -48
- data/spec/punchblock/translator/asterisk/component/output_spec.rb +231 -221
- data/spec/punchblock/translator/asterisk/component/record_spec.rb +82 -82
- data/spec/punchblock/translator/asterisk/component/stop_by_redirect_spec.rb +10 -10
- data/spec/punchblock/translator/asterisk/component_spec.rb +4 -4
- data/spec/punchblock/translator/asterisk_spec.rb +89 -82
- data/spec/punchblock/translator/freeswitch/call_spec.rb +114 -99
- data/spec/punchblock/translator/freeswitch/component/flite_output_spec.rb +19 -19
- data/spec/punchblock/translator/freeswitch/component/input_spec.rb +24 -24
- data/spec/punchblock/translator/freeswitch/component/output_spec.rb +23 -23
- data/spec/punchblock/translator/freeswitch/component/record_spec.rb +78 -78
- data/spec/punchblock/translator/freeswitch/component/tts_output_spec.rb +19 -19
- data/spec/punchblock/translator/freeswitch/component_spec.rb +8 -8
- data/spec/punchblock/translator/freeswitch_spec.rb +66 -59
- data/spec/punchblock/uri_list_spec.rb +45 -10
- data/spec/punchblock_spec.rb +13 -13
- data/spec/spec_helper.rb +18 -11
- data/spec/support/mock_connection_with_event_handler.rb +1 -1
- metadata +5 -4
data/spec/punchblock_spec.rb
CHANGED
|
@@ -7,47 +7,47 @@ describe Punchblock do
|
|
|
7
7
|
context 'with :xmpp' do
|
|
8
8
|
it 'sets up an XMPP connection, passing options, and a client with the connection attached' do
|
|
9
9
|
options = {:username => 'foo', :password => 'bar'}
|
|
10
|
-
Punchblock::Connection::XMPP.
|
|
10
|
+
expect(Punchblock::Connection::XMPP).to receive(:new).once.with(options).and_return mock_connection
|
|
11
11
|
client = Punchblock.client_with_connection :xmpp, options
|
|
12
|
-
client.
|
|
13
|
-
client.connection.
|
|
12
|
+
expect(client).to be_a Punchblock::Client
|
|
13
|
+
expect(client.connection).to be mock_connection
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
context 'with :XMPP' do
|
|
18
18
|
it 'sets up an XMPP connection, passing options, and a client with the connection attached' do
|
|
19
19
|
options = {:username => 'foo', :password => 'bar'}
|
|
20
|
-
Punchblock::Connection::XMPP.
|
|
20
|
+
expect(Punchblock::Connection::XMPP).to receive(:new).once.with(options).and_return mock_connection
|
|
21
21
|
client = Punchblock.client_with_connection :XMPP, options
|
|
22
|
-
client.
|
|
23
|
-
client.connection.
|
|
22
|
+
expect(client).to be_a Punchblock::Client
|
|
23
|
+
expect(client.connection).to be mock_connection
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
context 'with :asterisk' do
|
|
28
28
|
it 'sets up an Asterisk connection, passing options, and a client with the connection attached' do
|
|
29
29
|
options = {:username => 'foo', :password => 'bar'}
|
|
30
|
-
Punchblock::Connection::Asterisk.
|
|
30
|
+
expect(Punchblock::Connection::Asterisk).to receive(:new).once.with(options).and_return mock_connection
|
|
31
31
|
client = Punchblock.client_with_connection :asterisk, options
|
|
32
|
-
client.
|
|
33
|
-
client.connection.
|
|
32
|
+
expect(client).to be_a Punchblock::Client
|
|
33
|
+
expect(client.connection).to be mock_connection
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
context 'with :freeswitch' do
|
|
38
38
|
it 'sets up an Freeswitch connection, passing options, and a client with the connection attached' do
|
|
39
39
|
options = {:username => 'foo', :password => 'bar'}
|
|
40
|
-
Punchblock::Connection::Freeswitch.
|
|
40
|
+
expect(Punchblock::Connection::Freeswitch).to receive(:new).once.with(options).and_return mock_connection
|
|
41
41
|
client = Punchblock.client_with_connection :freeswitch, options
|
|
42
|
-
client.
|
|
43
|
-
client.connection.
|
|
42
|
+
expect(client).to be_a Punchblock::Client
|
|
43
|
+
expect(client.connection).to be mock_connection
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
context 'with :yate' do
|
|
48
48
|
it 'raises ArgumentError' do
|
|
49
49
|
options = {:username => 'foo', :password => 'bar'}
|
|
50
|
-
|
|
50
|
+
expect { Punchblock.client_with_connection :yate, options }.to raise_error(ArgumentError)
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -53,8 +53,15 @@ end
|
|
|
53
53
|
|
|
54
54
|
# FIXME: change this to rayo_event? It can be ambigous
|
|
55
55
|
shared_examples_for 'event' do
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
describe '#target_call_id' do
|
|
57
|
+
subject { super().target_call_id }
|
|
58
|
+
it { should be == '9f00061' }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
describe '#component_id' do
|
|
62
|
+
subject { super().component_id }
|
|
63
|
+
it { should be == '1' }
|
|
64
|
+
end
|
|
58
65
|
end
|
|
59
66
|
|
|
60
67
|
shared_examples_for 'command_headers' do
|
|
@@ -67,28 +74,28 @@ shared_examples_for 'key_value_pairs' do
|
|
|
67
74
|
it 'will auto-inherit nodes' do
|
|
68
75
|
n = parse_stanza "<#{element_name} name='boo' value='bah' />"
|
|
69
76
|
h = described_class.new n.root
|
|
70
|
-
h.name.
|
|
71
|
-
h.value.
|
|
77
|
+
expect(h.name).to eq('boo')
|
|
78
|
+
expect(h.value).to eq('bah')
|
|
72
79
|
end
|
|
73
80
|
|
|
74
81
|
it 'has a name attribute' do
|
|
75
82
|
n = described_class.new :boo, 'bah'
|
|
76
|
-
n.name.
|
|
83
|
+
expect(n.name).to eq('boo')
|
|
77
84
|
n.name = :foo
|
|
78
|
-
n.name.
|
|
85
|
+
expect(n.name).to eq('foo')
|
|
79
86
|
end
|
|
80
87
|
|
|
81
88
|
it 'has a value param' do
|
|
82
89
|
n = described_class.new :boo, 'en'
|
|
83
|
-
n.value.
|
|
90
|
+
expect(n.value).to eq('en')
|
|
84
91
|
n.value = 'de'
|
|
85
|
-
n.value.
|
|
92
|
+
expect(n.value).to eq('de')
|
|
86
93
|
end
|
|
87
94
|
|
|
88
95
|
it 'can determine equality' do
|
|
89
96
|
a = described_class.new :boo, 'bah'
|
|
90
|
-
a.
|
|
91
|
-
a.
|
|
92
|
-
a.
|
|
97
|
+
expect(a).to eq(described_class.new(:boo, 'bah'))
|
|
98
|
+
expect(a).not_to eq(described_class.new(:bah, 'bah'))
|
|
99
|
+
expect(a).not_to eq(described_class.new(:boo, 'boo'))
|
|
93
100
|
end
|
|
94
101
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: punchblock
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.5.
|
|
4
|
+
version: 2.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Goecke
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2014-
|
|
13
|
+
date: 2014-09-22 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: nokogiri
|
|
@@ -114,14 +114,14 @@ dependencies:
|
|
|
114
114
|
requirements:
|
|
115
115
|
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
117
|
+
version: 0.15.2
|
|
118
118
|
type: :runtime
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version:
|
|
124
|
+
version: 0.15.2
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: ruby_ami
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -369,6 +369,7 @@ extra_rdoc_files: []
|
|
|
369
369
|
files:
|
|
370
370
|
- ".document"
|
|
371
371
|
- ".gitignore"
|
|
372
|
+
- ".hound.yml"
|
|
372
373
|
- ".rspec"
|
|
373
374
|
- ".travis.yml"
|
|
374
375
|
- CHANGELOG.md
|