Skip to content

Commit fb3990a

Browse files
committed
Improve perf on creating large file name
1 parent 761c40a commit fb3990a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spec/fcm_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
end
2626

2727
let(:large_file_name) do
28-
1021.times.map do |el|
29-
"a"
30-
end.join('') + '.txt'
28+
Array.new(1021) {|el| "a"}.join("") + ".txt"
3129
end
3230

3331
let(:creds_error) do
@@ -69,7 +67,7 @@
6967
end
7068

7169
it 'raises an error when passed a large path' do
72-
expect do
70+
expect do
7371
FCM.new(large_file_name).__send__(:json_key)
7472
end.to raise_error(creds_error)
7573
end

0 commit comments

Comments
 (0)