Skip to content

Commit 237b448

Browse files
committed
Update rspec 2.13.0 -> 2.14.1
After updating rspec, I noticed some deprecation warnings about `stub`, instructing me to use `double` instead. So, I made that change at this time to help things be ready for the future. At the same time, I converted some double quotes to singles for code consistency, and aligned some `let` blocks on the curlies for readability. Change-Id: I9d0f1c82779962be44012cbcb020b79468108824 Reviewed-on: https://gerrit.causes.com/33806 Tested-by: jenkins <jenkins@causes.com> Reviewed-by: Shane da Silva <shane@causes.com>
1 parent 9e090be commit 237b448

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

overcommit.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
2121
Dir['bin/**/*'] +
2222
Dir['config/*.yml']
2323

24-
s.add_development_dependency 'rspec', '2.13.0'
24+
s.add_development_dependency 'rspec', '2.14.1'
2525
s.add_development_dependency 'image_optim', '0.9.1'
2626
end

spec/plugins/pre_commit/image_optimization/image_set_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
describe '#initialize(image_paths)' do
55
let(:path) { '/tmp/filename.jpg20131024-7103-s1d6n9.jpg' }
66

7-
it "sets the image_paths of the image set" do
7+
it 'sets the image_paths of the image set' do
88
image_set = described_class.new([path])
99
expect(image_set.image_paths).to eq([path])
1010
end
1111
end
1212

1313
describe '#optimize_with(ImageOptim)' do
14-
let(:optimized_image) { '/tmp/optimized.jpg' }
14+
let(:optimized_image) { '/tmp/optimized.jpg' }
1515
let(:unoptimized_image) { '/tmp/unoptimized.jpg' }
16-
let(:image_optim) { stub('ImageOptim') }
16+
let(:image_optim) { double('ImageOptim') }
1717

1818
it 'excludes already optimized images from the results' do
1919
image_optim.should_receive(:optimize_images!).

spec/plugins/pre_commit/image_optimization_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
describe Overcommit::GitHook::ImageOptimization do
55
describe '.filetypes' do
6-
it "includes only image filetypes" do
6+
it 'includes only image filetypes' do
77
expect(described_class.filetypes).to eq([:gif, :jpeg, :jpg, :png])
88
end
99
end
1010

1111
describe '#run_check' do
12-
let(:image_optim) { stub(ImageOptim) }
13-
let(:image_set) { stub(described_class::ImageSet) }
12+
let(:image_optim) { double(ImageOptim) }
13+
let(:image_set) { double(described_class::ImageSet) }
1414
let(:staged_filename) { 'filename.jpg' }
1515

1616
around do |example|

spec/plugins/pre_commit/ruby_style_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
end
1313

1414
describe '#rubocop_yml_for' do
15-
let(:staged_file) { stub(:original_path => 'some/dir') }
16-
let(:existing) { stub(:file? => true) }
17-
let(:non_existing) { stub(:file? => false) }
15+
let(:staged_file) { double(:original_path => 'some/dir') }
16+
let(:existing) { double(:file? => true) }
17+
let(:non_existing) { double(:file? => false) }
1818

1919
it 'returns the file that exists' do
2020
ruby_style.should_receive(:possible_files).
@@ -31,7 +31,7 @@
3131

3232
describe '#rubocop_config_mapping' do
3333
it 'inserts the staged files into a hash' do
34-
file = stub(:path => 'foobar/file.x')
34+
file = double(:path => 'foobar/file.x')
3535
ruby_style.stub(:staged => [file])
3636
ruby_style.should_receive(:rubocop_yml_for).with(file).and_return('boing')
3737
ruby_style.send(:rubocop_config_mapping).should eq('boing' => ['foobar/file.x'])

0 commit comments

Comments
 (0)