rspec-rayo 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/.document +5 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +3 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.md +72 -0
  7. data/Rakefile +22 -0
  8. data/lib/rspec-rayo/rayo/call.rb +135 -0
  9. data/lib/rspec-rayo/rayo/driver.rb +110 -0
  10. data/lib/rspec-rayo/rayo/matchers/ask.rb +60 -0
  11. data/lib/rspec-rayo/rayo/matchers/call_control.rb +105 -0
  12. data/lib/rspec-rayo/rayo/matchers/conference.rb +73 -0
  13. data/lib/rspec-rayo/rayo/matchers/dtmf.rb +21 -0
  14. data/lib/rspec-rayo/rayo/matchers/input.rb +60 -0
  15. data/lib/rspec-rayo/rayo/matchers/join.rb +56 -0
  16. data/lib/rspec-rayo/rayo/matchers/output.rb +15 -0
  17. data/lib/rspec-rayo/rayo/matchers/recording.rb +32 -0
  18. data/lib/rspec-rayo/rayo/matchers/say.rb +15 -0
  19. data/lib/rspec-rayo/rayo/matchers/transfer.rb +31 -0
  20. data/lib/rspec-rayo/rayo/matchers.rb +138 -0
  21. data/lib/rspec-rayo/tropo1/driver.rb +51 -0
  22. data/lib/rspec-rayo/version.rb +3 -0
  23. data/lib/rspec-rayo.rb +7 -0
  24. data/rspec-rayo.gemspec +31 -0
  25. data/spec/rspec-rayo/rayo/matchers/ask_spec.rb +43 -0
  26. data/spec/rspec-rayo/rayo/matchers/call_control_spec.rb +83 -0
  27. data/spec/rspec-rayo/rayo/matchers/conference_spec.rb +54 -0
  28. data/spec/rspec-rayo/rayo/matchers/dtmf_spec.rb +16 -0
  29. data/spec/rspec-rayo/rayo/matchers/input_spec.rb +43 -0
  30. data/spec/rspec-rayo/rayo/matchers/join_spec.rb +33 -0
  31. data/spec/rspec-rayo/rayo/matchers/output_spec.rb +23 -0
  32. data/spec/rspec-rayo/rayo/matchers/say_spec.rb +23 -0
  33. data/spec/rspec-rayo/rayo/matchers/transfer_spec.rb +23 -0
  34. data/spec/rspec-rayo/rayo/matchers_spec.rb +30 -0
  35. data/spec/spec_helper.rb +8 -0
  36. metadata +193 -0
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Rayo call control matchers" do
4
+ describe "a joined event" do
5
+ subject do
6
+ Punchblock::Event::Joined.new(:other_call_id => 'foo', :mixer_id => 'foo1').tap do |event|
7
+ event.call_id = '5d6fe904-103d-4551-bd47-cf212c37b8c7'
8
+ event.component_id = '6d5bf745-8fa9-4e78-be18-6e6a48393f13'
9
+ end
10
+ end
11
+
12
+ it { should be_a_valid_joined_event }
13
+ it { should be_a_valid_joined_event.with_other_call_id('foo') }
14
+ it { should_not be_a_valid_joined_event.with_other_call_id('bar') }
15
+ it { should be_a_valid_joined_event.with_mixer_id('foo1') }
16
+ it { should_not be_a_valid_joined_event.with_mixer_id('bar1') }
17
+ end
18
+
19
+ describe "an unjoined event" do
20
+ subject do
21
+ Punchblock::Event::Unjoined.new(:other_call_id => 'foo', :mixer_id => 'foo1').tap do |event|
22
+ event.call_id = '5d6fe904-103d-4551-bd47-cf212c37b8c7'
23
+ event.component_id = '6d5bf745-8fa9-4e78-be18-6e6a48393f13'
24
+ end
25
+ end
26
+
27
+ it { should be_a_valid_unjoined_event }
28
+ it { should be_a_valid_unjoined_event.with_other_call_id('foo') }
29
+ it { should_not be_a_valid_unjoined_event.with_other_call_id('bar') }
30
+ it { should be_a_valid_unjoined_event.with_mixer_id('foo1') }
31
+ it { should_not be_a_valid_unjoined_event.with_mixer_id('bar1') }
32
+ end
33
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Rayo Output matchers" do
4
+ describe "a output complete event" do
5
+ subject do
6
+ Punchblock::Event::Complete.new.tap do |event|
7
+ event.call_id = '5d6fe904-103d-4551-bd47-cf212c37b8c7'
8
+ event.component_id = '6d5bf745-8fa9-4e78-be18-6e6a48393f13'
9
+ event << reason
10
+ end
11
+ end
12
+
13
+ describe "that's successful" do
14
+ let(:reason) { Punchblock::Component::Output::Complete::Success.new }
15
+ it { should be_a_valid_output_event }
16
+ end
17
+
18
+ describe "that stopped" do
19
+ let(:reason) { Punchblock::Event::Complete::Stop.new }
20
+ it { should be_a_valid_complete_stopped_event }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Rayo Say matchers" do
4
+ describe "a say complete event" do
5
+ subject do
6
+ Punchblock::Event::Complete.new.tap do |event|
7
+ event.call_id = '5d6fe904-103d-4551-bd47-cf212c37b8c7'
8
+ event.component_id = '6d5bf745-8fa9-4e78-be18-6e6a48393f13'
9
+ event << reason
10
+ end
11
+ end
12
+
13
+ describe "that's successful" do
14
+ let(:reason) { Punchblock::Component::Tropo::Say::Complete::Success.new }
15
+ it { should be_a_valid_say_event }
16
+ end
17
+
18
+ describe "that stopped" do
19
+ let(:reason) { Punchblock::Event::Complete::Stop.new }
20
+ it { should be_a_valid_complete_stopped_event }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Rayo call control matchers" do
4
+ describe "a transfer complete event" do
5
+ subject do
6
+ Punchblock::Event::Complete.new.tap do |event|
7
+ event.call_id = '5d6fe904-103d-4551-bd47-cf212c37b8c7'
8
+ event.component_id = '6d5bf745-8fa9-4e78-be18-6e6a48393f13'
9
+ event << reason
10
+ end
11
+ end
12
+
13
+ describe "that's successful" do
14
+ let(:reason) { Punchblock::Component::Tropo::Transfer::Complete::Success.new }
15
+ it { should be_a_valid_transfer_event }
16
+ end
17
+
18
+ describe "that timed out" do
19
+ let(:reason) { Punchblock::Component::Tropo::Transfer::Complete::Timeout.new }
20
+ it { should be_a_valid_transfer_timeout_event }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Rayo call control matchers" do
4
+ describe "a complete hangup event" do
5
+ subject do
6
+ Punchblock::Event::Complete.new.tap do |event|
7
+ event.call_id = '5d6fe904-103d-4551-bd47-cf212c37b8c7'
8
+ event.component_id = '6d5bf745-8fa9-4e78-be18-6e6a48393f13'
9
+ event << Punchblock::Event::Complete::Hangup.new
10
+ end
11
+ end
12
+
13
+ it { should be_a_valid_complete_hangup_event }
14
+ end
15
+
16
+ describe "a complete error event" do
17
+ subject do
18
+ Punchblock::Event::Complete.new.tap do |event|
19
+ event.call_id = '5d6fe904-103d-4551-bd47-cf212c37b8c7'
20
+ event.component_id = '6d5bf745-8fa9-4e78-be18-6e6a48393f13'
21
+ reason = Punchblock::Event::Complete::Error.new
22
+ reason << "It's all broke"
23
+ event << reason
24
+ end
25
+ end
26
+
27
+ it { should be_a_valid_complete_error_event.with_message("It's all broke") }
28
+ it { should_not be_a_valid_complete_error_event.with_message("It's all working") }
29
+ end
30
+ end
@@ -0,0 +1,8 @@
1
+ require 'rspec'
2
+ require 'rspec-rayo'
3
+ require 'punchblock'
4
+
5
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
6
+
7
+ RSpec.configure do |config|
8
+ end
metadata ADDED
@@ -0,0 +1,193 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-rayo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.14
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jason Goecke
9
+ - Ben Langfeld
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2011-09-15 00:00:00.000000000 +01:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rspec
18
+ requirement: &2169015740 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: 2.6.0
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: *2169015740
27
+ - !ruby/object:Gem::Dependency
28
+ name: punchblock
29
+ requirement: &2169015220 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: 0.4.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *2169015220
38
+ - !ruby/object:Gem::Dependency
39
+ name: countdownlatch
40
+ requirement: &2169014740 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.0.0
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: *2169014740
49
+ - !ruby/object:Gem::Dependency
50
+ name: future-resource
51
+ requirement: &2169014260 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: 0.0.2
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: *2169014260
60
+ - !ruby/object:Gem::Dependency
61
+ name: yard
62
+ requirement: &2169013760 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: 0.6.0
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: *2169013760
71
+ - !ruby/object:Gem::Dependency
72
+ name: bundler
73
+ requirement: &2168995360 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ version: 1.0.0
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: *2168995360
82
+ - !ruby/object:Gem::Dependency
83
+ name: rcov
84
+ requirement: &2168994880 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: *2168994880
93
+ - !ruby/object:Gem::Dependency
94
+ name: rake
95
+ requirement: &2168994400 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ type: :development
102
+ prerelease: false
103
+ version_requirements: *2168994400
104
+ - !ruby/object:Gem::Dependency
105
+ name: ci_reporter
106
+ requirement: &2168993920 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: 1.6.3
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: *2168993920
115
+ description: Rspec2 Matchers for Rayo
116
+ email: jsgoecke@voxeo.com, ben@langfeld.me
117
+ executables: []
118
+ extensions: []
119
+ extra_rdoc_files: []
120
+ files:
121
+ - .document
122
+ - .gitignore
123
+ - .rspec
124
+ - Gemfile
125
+ - LICENSE.txt
126
+ - README.md
127
+ - Rakefile
128
+ - lib/rspec-rayo.rb
129
+ - lib/rspec-rayo/rayo/call.rb
130
+ - lib/rspec-rayo/rayo/driver.rb
131
+ - lib/rspec-rayo/rayo/matchers.rb
132
+ - lib/rspec-rayo/rayo/matchers/ask.rb
133
+ - lib/rspec-rayo/rayo/matchers/call_control.rb
134
+ - lib/rspec-rayo/rayo/matchers/conference.rb
135
+ - lib/rspec-rayo/rayo/matchers/dtmf.rb
136
+ - lib/rspec-rayo/rayo/matchers/input.rb
137
+ - lib/rspec-rayo/rayo/matchers/join.rb
138
+ - lib/rspec-rayo/rayo/matchers/output.rb
139
+ - lib/rspec-rayo/rayo/matchers/recording.rb
140
+ - lib/rspec-rayo/rayo/matchers/say.rb
141
+ - lib/rspec-rayo/rayo/matchers/transfer.rb
142
+ - lib/rspec-rayo/tropo1/driver.rb
143
+ - lib/rspec-rayo/version.rb
144
+ - rspec-rayo.gemspec
145
+ - spec/rspec-rayo/rayo/matchers/ask_spec.rb
146
+ - spec/rspec-rayo/rayo/matchers/call_control_spec.rb
147
+ - spec/rspec-rayo/rayo/matchers/conference_spec.rb
148
+ - spec/rspec-rayo/rayo/matchers/dtmf_spec.rb
149
+ - spec/rspec-rayo/rayo/matchers/input_spec.rb
150
+ - spec/rspec-rayo/rayo/matchers/join_spec.rb
151
+ - spec/rspec-rayo/rayo/matchers/output_spec.rb
152
+ - spec/rspec-rayo/rayo/matchers/say_spec.rb
153
+ - spec/rspec-rayo/rayo/matchers/transfer_spec.rb
154
+ - spec/rspec-rayo/rayo/matchers_spec.rb
155
+ - spec/spec_helper.rb
156
+ has_rdoc: true
157
+ homepage: http://github.com/tropo/rspec-rayo
158
+ licenses:
159
+ - MIT
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ none: false
166
+ requirements:
167
+ - - ! '>='
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ! '>='
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 1.6.2
179
+ signing_key:
180
+ specification_version: 3
181
+ summary: Rspec2 for Rayo
182
+ test_files:
183
+ - spec/rspec-rayo/rayo/matchers/ask_spec.rb
184
+ - spec/rspec-rayo/rayo/matchers/call_control_spec.rb
185
+ - spec/rspec-rayo/rayo/matchers/conference_spec.rb
186
+ - spec/rspec-rayo/rayo/matchers/dtmf_spec.rb
187
+ - spec/rspec-rayo/rayo/matchers/input_spec.rb
188
+ - spec/rspec-rayo/rayo/matchers/join_spec.rb
189
+ - spec/rspec-rayo/rayo/matchers/output_spec.rb
190
+ - spec/rspec-rayo/rayo/matchers/say_spec.rb
191
+ - spec/rspec-rayo/rayo/matchers/transfer_spec.rb
192
+ - spec/rspec-rayo/rayo/matchers_spec.rb
193
+ - spec/spec_helper.rb