We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3804bb4 commit 5e5ec51Copy full SHA for 5e5ec51
1 file changed
language/spec/language_spec.rb
@@ -24,10 +24,13 @@
24
# Upload a file to Google Cloud Storage for testing
25
# Uploaded files will be deleted after each test
26
def upload file_name, text_content
27
- local_file_path = Tempfile.new.path
28
- File.write local_file_path, text_content
29
- @bucket.create_file local_file_path, file_name
+ local_file = Tempfile.new "language-test-file"
+ File.write local_file.path, text_content
+ @bucket.create_file local_file.path, file_name
30
@uploaded << file_name
31
+ ensure
32
+ local_file.close
33
+ local_file.unlink
34
end
35
36
# Capture and return STDOUT output by block
0 commit comments