Skip to content

Commit 87183b5

Browse files
committed
(CONT-807) Correct RSpec/HookArgument
1 parent 5e78744 commit 87183b5

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

spec/unit/puppetlabs_spec_helper/tasks/check_symlinks_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper'
44

55
describe 'rake check:symlinks', type: :task do
6-
before(:each) do
6+
before do
77
test_files.each do |f|
88
FileUtils.mkdir_p(File.dirname(f))
99
FileUtils.touch(f)
@@ -115,7 +115,7 @@
115115
end
116116

117117
context 'when there are symlinks under a directory listed in .gitignore' do
118-
before(:each) do
118+
before do
119119
File.write(File.join(Dir.pwd, '.gitignore'), "a_directory/\n")
120120
end
121121

@@ -137,7 +137,7 @@
137137
end
138138

139139
context 'when there are symlinks under a directory listed in .pdkignore' do
140-
before(:each) do
140+
before do
141141
File.open(File.join(Dir.pwd, '.pdkignore'), 'w') do |f|
142142
f.puts '/another_directory/'
143143
end

spec/unit/puppetlabs_spec_helper/tasks/check_test_file_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
describe 'rake check:test_file', type: :task do
66
context 'when there are .pp files under tests/' do
7-
before(:each) do
7+
before do
88
test_files.each do |f|
99
FileUtils.mkdir_p(File.dirname(f))
1010
FileUtils.touch(f)
@@ -28,7 +28,7 @@
2828
end
2929

3030
context 'when there are no .pp files under tests/' do
31-
before(:each) do
31+
before do
3232
FileUtils.mkdir('tests')
3333
end
3434

spec/unit/puppetlabs_spec_helper/tasks/fixture_helpers_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
describe '.module_name' do
88
subject(:module_name) { described_class.module_name }
99

10-
before(:each) do
10+
before do
1111
allow(Dir).to receive(:pwd).and_return(File.join('path', 'to', 'my-awsome-module_from_pwd'))
1212
end
1313

@@ -24,28 +24,28 @@
2424
end
2525

2626
context 'when metadata.json does not exist' do
27-
before(:each) do
27+
before do
2828
allow(File).to receive(:file?).with('metadata.json').and_return(false)
2929
end
3030

3131
it_behaves_like 'module name from working directory'
3232
end
3333

3434
context 'when metadata.json does exist' do
35-
before(:each) do
35+
before do
3636
allow(File).to receive(:file?).with('metadata.json').and_return(true)
3737
end
3838

3939
context 'when it is not readable' do
40-
before(:each) do
40+
before do
4141
allow(File).to receive(:readable?).with('metadata.json').and_return(false)
4242
end
4343

4444
it_behaves_like 'module name from working directory'
4545
end
4646

4747
context 'when it is readable' do
48-
before(:each) do
48+
before do
4949
allow(File).to receive(:readable?).with('metadata.json').and_return(true)
5050
allow(File).to receive(:read).with('metadata.json').and_return(metadata_content)
5151
end
@@ -86,7 +86,7 @@
8686
describe '.fixtures' do
8787
subject(:helper) { described_class }
8888

89-
before :each do
89+
before do
9090
# Unstub the fixtures "helpers"
9191
PuppetlabsSpec::Fixtures.instance_methods.each do |m|
9292
PuppetlabsSpec::Fixtures.send(:undef_method, m)
@@ -166,7 +166,7 @@
166166
end
167167

168168
context 'when file specifies repository fixtures' do
169-
before(:each) do
169+
before do
170170
allow(File).to receive(:exist?).with('.fixtures.yml').and_return true
171171
allow(YAML).to receive(:load_file).with('.fixtures.yml').and_return(
172172
'fixtures' => {
@@ -190,7 +190,7 @@
190190
end
191191

192192
context 'when file specifies repository fixtures with an invalid git ref' do
193-
before(:each) do
193+
before do
194194
allow(File).to receive(:exist?).with('.fixtures.yml').and_return true
195195
allow(YAML).to receive(:load_file).with('.fixtures.yml').and_return(
196196
'fixtures' => {

0 commit comments

Comments
 (0)