rspec-rayo 0.1.16 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ module RSpecRayo
9
9
  @call_event = FutureResource.new
10
10
  self.call_event = options[:call_event] if options[:call_event]
11
11
  @ring_event = FutureResource.new
12
- @protocol = options[:protocol]
12
+ @client = options[:client]
13
13
  @queue = options[:queue]
14
14
  @read_timeout = options[:read_timeout] || 5
15
15
  @write_timeout = options[:write_timeout] || 5
@@ -128,7 +128,8 @@ module RSpecRayo
128
128
  private
129
129
 
130
130
  def write(msg)
131
- response = @protocol.write @call_id, msg
131
+ response = @client.execute_command msg, :call_id => @call_id, :async => false
132
+ raise response if response.is_a?(Exception)
132
133
  msg if response
133
134
  end
134
135
  end
@@ -25,7 +25,7 @@ module RSpecRayo
25
25
  end
26
26
 
27
27
  def dial(options)
28
- Call.new(:protocol => @rayo, :queue => Queue.new, :read_timeout => @queue_timeout, :write_timeout => @write_timeout).tap do |call|
28
+ Call.new(:client => @rayo, :queue => Queue.new, :read_timeout => @queue_timeout, :write_timeout => @write_timeout).tap do |call|
29
29
  dial = call.dial options
30
30
  call.call_id = dial.call_id
31
31
  @calls.merge! call.call_id => call
@@ -41,7 +41,7 @@ module RSpecRayo
41
41
  case event
42
42
  when Punchblock::Event::Offer
43
43
  call = Call.new :call_event => event,
44
- :protocol => @rayo,
44
+ :client => @rayo,
45
45
  :queue => Queue.new,
46
46
  :read_timeout => @queue_timeout,
47
47
  :write_timeout => @write_timeout
@@ -74,14 +74,15 @@ module RSpecRayo
74
74
  initialize_logging options
75
75
 
76
76
  # Setup our Rayo environment
77
- @rayo = Punchblock::Connection.new :username => options[:username],
78
- :password => options[:password],
79
- :host => options[:host],
80
- :port => options[:port],
81
- :wire_logger => @wire_logger,
82
- :transport_logger => @transport_logger,
83
- :auto_reconnect => false,
84
- :write_timeout => options[:write_timeout]
77
+ connection = Punchblock::Connection::XMPP.new :username => options[:username],
78
+ :password => options[:password],
79
+ :host => options[:host],
80
+ :port => options[:port],
81
+ :wire_logger => @wire_logger,
82
+ :transport_logger => @transport_logger,
83
+ :auto_reconnect => false
84
+ @rayo = Punchblock::Client.new :connection => connection,
85
+ :write_timeout => options[:write_timeout]
85
86
  @event_queue = @rayo.event_queue
86
87
 
87
88
  start_rayo
@@ -1,3 +1,3 @@
1
1
  module RSpecRayo
2
- VERSION = "0.1.16"
2
+ VERSION = "0.2.0"
3
3
  end
data/rspec-rayo.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_dependency %q<rspec>, [">= 2.6.0"]
22
- s.add_dependency %q<punchblock>, [">= 0.4.2"]
22
+ s.add_dependency %q<punchblock>, [">= 0.5.0"]
23
23
  s.add_dependency %q<countdownlatch>, [">= 1.0.0"]
24
24
  s.add_dependency %q<future-resource>, [">= 0.0.2"]
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-rayo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,12 +10,12 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-10-10 00:00:00.000000000 -07:00
13
+ date: 2011-10-30 01:00:00.000000000 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec
18
- requirement: &2169308840 !ruby/object:Gem::Requirement
18
+ requirement: &2156850680 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,21 +23,21 @@ dependencies:
23
23
  version: 2.6.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2169308840
26
+ version_requirements: *2156850680
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: punchblock
29
- requirement: &2169308220 !ruby/object:Gem::Requirement
29
+ requirement: &2156850160 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
33
33
  - !ruby/object:Gem::Version
34
- version: 0.4.2
34
+ version: 0.5.0
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *2169308220
37
+ version_requirements: *2156850160
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: countdownlatch
40
- requirement: &2169307540 !ruby/object:Gem::Requirement
40
+ requirement: &2156849660 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: 1.0.0
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *2169307540
48
+ version_requirements: *2156849660
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: future-resource
51
- requirement: &2169306880 !ruby/object:Gem::Requirement
51
+ requirement: &2156849160 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: 0.0.2
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *2169306880
59
+ version_requirements: *2156849160
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: yard
62
- requirement: &2169306400 !ruby/object:Gem::Requirement
62
+ requirement: &2156848580 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 0.6.0
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *2169306400
70
+ version_requirements: *2156848580
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: bundler
73
- requirement: &2169305860 !ruby/object:Gem::Requirement
73
+ requirement: &2156847980 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ~>
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: 1.0.0
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *2169305860
81
+ version_requirements: *2156847980
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: rcov
84
- requirement: &2169305240 !ruby/object:Gem::Requirement
84
+ requirement: &2156847440 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *2169305240
92
+ version_requirements: *2156847440
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rake
95
- requirement: &2169304600 !ruby/object:Gem::Requirement
95
+ requirement: &2156846840 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: '0'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *2169304600
103
+ version_requirements: *2156846840
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: ci_reporter
106
- requirement: &2169304120 !ruby/object:Gem::Requirement
106
+ requirement: &2156846240 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,7 +111,7 @@ dependencies:
111
111
  version: 1.6.3
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *2169304120
114
+ version_requirements: *2156846240
115
115
  description: Rspec2 Matchers for Rayo
116
116
  email: jsgoecke@voxeo.com, ben@langfeld.me
117
117
  executables: []