Skip to content

Commit 8941208

Browse files
committed
Fix rspec deprecation warnings
1 parent 3988e57 commit 8941208

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

spec/lib/synapse/haproxy_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class MockWatcher; end;
77

88
it 'updating the config' do
99
mockWatcher = double(Synapse::ServiceWatcher)
10-
subject.should_receive(:generate_config)
10+
expect(subject).to receive(:generate_config)
1111
subject.update_config([mockWatcher])
1212
end
1313
end

spec/lib/synapse/service_watcher_ec2tags_spec.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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 }

spec/spec_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
require 'support/configuration'
1010

1111
RSpec.configure do |config|
12-
config.treat_symbols_as_metadata_keys_with_true_values = true
1312
config.run_all_when_everything_filtered = true
1413
config.filter_run :focus
1514
config.include Configuration

0 commit comments

Comments
 (0)