Skip to content

Commit ca39db9

Browse files
committed
Add Rubocop ignore for Style/FileOpen cop
According to Rubocop the issue here is: `File.open` without a block may leak a file descriptor; use the block form. However, in this case it's a very specific set of tests that require multiple files to be opened so the data can be loaded from static fixture files. The files are closed afterwards, so I've decided to ignore the cop in this instance
1 parent 0633159 commit ca39db9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

spec/lss_loader_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def create_a_single_office
202202
id
203203
end
204204

205-
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/ParameterLists
205+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/ParameterLists, Style/FileOpen
206206
def load_from_fixtures(members_csv_filename: "empty",
207207
locations_csv_filename: "empty",
208208
opening_hours_csv_filename: "empty",
@@ -236,7 +236,7 @@ def load_from_fixtures(members_csv_filename: "empty",
236236
volunteer_roles_csv&.close
237237
local_authorities_csv&.close
238238
end
239-
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/ParameterLists
239+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/ParameterLists, Style/FileOpen
240240

241241
def load_from_fixtures_with_error(**)
242242
expect do

0 commit comments

Comments
 (0)