Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 282eb1d

Browse files
committed
Fix rubocop violations on main
1 parent 4b9a3b7 commit 282eb1d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/cli_test.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_plugin_args_with_config_file
218218
Result = Struct.new(:status, :stdio, :stderr, keyword_init: true)
219219

220220
def run_cli(command, *args, contents: :default)
221-
file =
221+
tempfile =
222222
case contents
223223
when :default
224224
Tempfile.new(%w[test- .rb]).tap { |file| file.puts("test") }
@@ -228,16 +228,18 @@ def run_cli(command, *args, contents: :default)
228228
contents
229229
end
230230

231-
file.rewind
231+
tempfile.rewind
232232

233233
status = nil
234234
stdio, stderr =
235-
capture_io { status = SyntaxTree::CLI.run([command, *args, file.path]) }
235+
capture_io do
236+
status = SyntaxTree::CLI.run([command, *args, tempfile.path])
237+
end
236238

237239
Result.new(status: status, stdio: stdio, stderr: stderr)
238240
ensure
239-
file.close
240-
file.unlink
241+
tempfile.close
242+
tempfile.unlink
241243
end
242244

243245
def with_config_file(contents)

0 commit comments

Comments
 (0)