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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +2 -0
  3. data/CHANGELOG.md +6 -0
  4. data/README.markdown +2 -1
  5. data/lib/punchblock/translator/asterisk/call.rb +3 -3
  6. data/lib/punchblock/translator/asterisk/component/mrcp_recog_prompt.rb +15 -9
  7. data/lib/punchblock/translator/asterisk/component/output.rb +8 -1
  8. data/lib/punchblock/translator/input_component.rb +2 -0
  9. data/lib/punchblock/version.rb +1 -1
  10. data/punchblock.gemspec +1 -1
  11. data/spec/punchblock/client/component_registry_spec.rb +3 -3
  12. data/spec/punchblock/client_spec.rb +22 -15
  13. data/spec/punchblock/command/accept_spec.rb +17 -7
  14. data/spec/punchblock/command/answer_spec.rb +19 -9
  15. data/spec/punchblock/command/dial_spec.rb +76 -27
  16. data/spec/punchblock/command/hangup_spec.rb +17 -7
  17. data/spec/punchblock/command/join_spec.rb +78 -24
  18. data/spec/punchblock/command/mute_spec.rb +3 -3
  19. data/spec/punchblock/command/redirect_spec.rb +33 -12
  20. data/spec/punchblock/command/reject_spec.rb +41 -14
  21. data/spec/punchblock/command/unjoin_spec.rb +29 -12
  22. data/spec/punchblock/command/unmute_spec.rb +3 -3
  23. data/spec/punchblock/command_node_spec.rb +43 -20
  24. data/spec/punchblock/component/asterisk/agi/command_spec.rb +52 -12
  25. data/spec/punchblock/component/asterisk/ami/action_spec.rb +69 -21
  26. data/spec/punchblock/component/component_node_spec.rb +12 -12
  27. data/spec/punchblock/component/input_spec.rb +304 -87
  28. data/spec/punchblock/component/output_spec.rb +434 -173
  29. data/spec/punchblock/component/prompt_spec.rb +63 -20
  30. data/spec/punchblock/component/receive_fax_spec.rb +43 -14
  31. data/spec/punchblock/component/record_spec.rb +215 -71
  32. data/spec/punchblock/component/send_fax_spec.rb +54 -15
  33. data/spec/punchblock/connection/asterisk_spec.rb +34 -24
  34. data/spec/punchblock/connection/freeswitch_spec.rb +9 -9
  35. data/spec/punchblock/connection/xmpp_spec.rb +92 -83
  36. data/spec/punchblock/event/answered_spec.rb +14 -4
  37. data/spec/punchblock/event/asterisk/ami/event_spec.rb +34 -12
  38. data/spec/punchblock/event/complete_spec.rb +36 -16
  39. data/spec/punchblock/event/dtmf_spec.rb +9 -3
  40. data/spec/punchblock/event/end_spec.rb +43 -10
  41. data/spec/punchblock/event/input_timers_started_spec.rb +1 -1
  42. data/spec/punchblock/event/joined_spec.rb +29 -7
  43. data/spec/punchblock/event/offer_spec.rb +41 -10
  44. data/spec/punchblock/event/ringing_spec.rb +14 -4
  45. data/spec/punchblock/event/started_speaking_spec.rb +9 -3
  46. data/spec/punchblock/event/stopped_speaking_spec.rb +9 -3
  47. data/spec/punchblock/event/unjoined_spec.rb +24 -6
  48. data/spec/punchblock/protocol_error_spec.rb +16 -13
  49. data/spec/punchblock/ref_spec.rb +90 -26
  50. data/spec/punchblock/translator/asterisk/call_spec.rb +176 -161
  51. data/spec/punchblock/translator/asterisk/component/asterisk/agi_command_spec.rb +18 -18
  52. data/spec/punchblock/translator/asterisk/component/asterisk/ami_action_spec.rb +9 -9
  53. data/spec/punchblock/translator/asterisk/component/composed_prompt_spec.rb +14 -14
  54. data/spec/punchblock/translator/asterisk/component/input_spec.rb +57 -36
  55. data/spec/punchblock/translator/asterisk/component/mrcp_native_prompt_spec.rb +50 -50
  56. data/spec/punchblock/translator/asterisk/component/mrcp_prompt_spec.rb +59 -48
  57. data/spec/punchblock/translator/asterisk/component/output_spec.rb +231 -221
  58. data/spec/punchblock/translator/asterisk/component/record_spec.rb +82 -82
  59. data/spec/punchblock/translator/asterisk/component/stop_by_redirect_spec.rb +10 -10
  60. data/spec/punchblock/translator/asterisk/component_spec.rb +4 -4
  61. data/spec/punchblock/translator/asterisk_spec.rb +89 -82
  62. data/spec/punchblock/translator/freeswitch/call_spec.rb +114 -99
  63. data/spec/punchblock/translator/freeswitch/component/flite_output_spec.rb +19 -19
  64. data/spec/punchblock/translator/freeswitch/component/input_spec.rb +24 -24
  65. data/spec/punchblock/translator/freeswitch/component/output_spec.rb +23 -23
  66. data/spec/punchblock/translator/freeswitch/component/record_spec.rb +78 -78
  67. data/spec/punchblock/translator/freeswitch/component/tts_output_spec.rb +19 -19
  68. data/spec/punchblock/translator/freeswitch/component_spec.rb +8 -8
  69. data/spec/punchblock/translator/freeswitch_spec.rb +66 -59
  70. data/spec/punchblock/uri_list_spec.rb +45 -10
  71. data/spec/punchblock_spec.rb +13 -13
  72. data/spec/spec_helper.rb +18 -11
  73. data/spec/support/mock_connection_with_event_handler.rb +1 -1
  74. metadata +5 -4
@@ -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.should_receive(:new).once.with(options).and_return mock_connection
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.should be_a Punchblock::Client
13
- client.connection.should be mock_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.should_receive(:new).once.with(options).and_return mock_connection
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.should be_a Punchblock::Client
23
- client.connection.should be mock_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.should_receive(:new).once.with(options).and_return mock_connection
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.should be_a Punchblock::Client
33
- client.connection.should be mock_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.should_receive(:new).once.with(options).and_return mock_connection
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.should be_a Punchblock::Client
43
- client.connection.should be mock_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
- lambda { Punchblock.client_with_connection :yate, options }.should raise_error(ArgumentError)
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
- its(:target_call_id) { should be == '9f00061' }
57
- its(:component_id) { should be == '1' }
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.should be == 'boo'
71
- h.value.should be == 'bah'
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.should be == 'boo'
83
+ expect(n.name).to eq('boo')
77
84
  n.name = :foo
78
- n.name.should be == 'foo'
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.should be == 'en'
90
+ expect(n.value).to eq('en')
84
91
  n.value = 'de'
85
- n.value.should be == 'de'
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.should be == described_class.new(:boo, 'bah')
91
- a.should_not be == described_class.new(:bah, 'bah')
92
- a.should_not be == described_class.new(:boo, 'boo')
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
@@ -4,7 +4,7 @@ module HasMockCallbackConnection
4
4
  def self.included(test_case)
5
5
  test_case.let(:connection) do
6
6
  double('Connection').tap do |mc|
7
- mc.stub :handle_event do |event|
7
+ allow(mc).to receive :handle_event do |event|
8
8
  original_command.add_event event
9
9
  end
10
10
  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.2
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-04-03 00:00:00.000000000 Z
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: '0.14'
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: '0.14'
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