@@ -135,39 +135,37 @@ def munge_haproxy_arg(name, new_value)
135135 # done remotely; breaking into separate calls would result in
136136 # unnecessary data being retrieved.
137137
138- subject . ec2 . should_receive ( :instances ) . and_return ( instance_collection )
138+ expect ( subject . ec2 ) . to receive ( :instances ) . and_return ( instance_collection )
139139
140- instance_collection . should_receive ( :tagged ) . with ( 'foo' ) . and_return ( instance_collection )
141- instance_collection . should_receive ( :tagged_values ) . with ( 'bar' ) . and_return ( instance_collection )
142- instance_collection . should_receive ( :select ) . and_return ( instance_collection )
140+ expect ( instance_collection ) . to receive ( :tagged ) . with ( 'foo' ) . and_return ( instance_collection )
141+ expect ( instance_collection ) . to receive ( :tagged_values ) . with ( 'bar' ) . and_return ( instance_collection )
142+ expect ( instance_collection ) . to receive ( :select ) . and_return ( instance_collection )
143143
144144 subject . send ( :instances_with_tags , 'foo' , 'bar' )
145145 end
146146 end
147147
148148 context 'returned backend data structure' do
149149 before do
150- subject . stub ( :instances_with_tags ) . and_return ( [ instance1 , instance2 ] )
150+ expect ( subject ) . to receive ( :instances_with_tags ) . and_return ( [ instance1 , instance2 ] )
151151 end
152152
153153 let ( :backends ) { subject . send ( :discover_instances ) }
154154
155155 it 'returns an Array of backend name/host/port Hashes' do
156156
157- expect { backends . all? { |b | %w[ name host port ] . each { |k | b . has_key? ( k ) } } } . to be_true
157+ expect ( backends . all? { |b | %w[ name host port ] . each { |k | b . has_key? ( k ) } } ) . to eql ( true )
158158 end
159159
160160 it 'sets the backend port to server_port_override for all backends' do
161161 backends = subject . send ( :discover_instances )
162- expect {
163- backends . all? { |b | b [ 'port' ] == basic_config [ 'haproxy' ] [ 'server_port_override' ] }
164- } . to be_true
162+ expect ( backends . all? { |b | b [ 'port' ] == basic_config [ 'haproxy' ] [ 'server_port_override' ] } ) . to eql ( true )
165163 end
166164 end
167165
168166 context 'returned instance fields' do
169167 before do
170- subject . stub ( :instances_with_tags ) . and_return ( [ instance1 ] )
168+ expect ( subject ) . to receive ( :instances_with_tags ) . and_return ( [ instance1 ] )
171169 end
172170
173171 let ( :backend ) { subject . send ( :discover_instances ) . pop }
0 commit comments