Skip to content

Commit 6834bfd

Browse files
committed
Use in_tmp_dir in place of Dir.mktmpdir in update metadata tests
This should have ensured that not only we create a temporary directory but also `cd` into it to avoid scenarios where the state of the Git repo affects the tests outcome (see the need for stubbing the Fastlane Git helper in `ios_update_metadata_source_spec.rb`) Unfortunately, this doesn't seem to do the trick. If the stub call is removed, the test fails.
1 parent 030bb70 commit 6834bfd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/shared_examples_for_update_metadata_source_action.rb

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

33
RSpec.shared_examples 'update_metadata_source_action' do |options|
44
it 'updates any block in a given .po file with the values from the given sources' do
5-
Dir.mktmpdir do |dir|
5+
in_tmp_dir do |dir|
66
output_path = File.join(dir, 'output.po')
77
dummy_text = <<~PO
88
msgctxt "key1"
@@ -45,7 +45,7 @@
4545
it 'combines the given `release_version` and `whats_new` parameter into a new block' do
4646
pending 'this currently fails; in the long run, we might consolidate `whats_new` with `release_notes`' if options[:whats_new_fails]
4747

48-
Dir.mktmpdir do |dir|
48+
in_tmp_dir do |dir|
4949
output_path = File.join(dir, 'output.po')
5050
dummy_text = <<~PO
5151
msgctxt "v1.0-whats-new"
@@ -80,7 +80,7 @@
8080
it 'adds entries passed as input even if not part of the original `.po` file' do
8181
pending 'this currently fails and will be addressed as part of the upcoming refactor/rewrite of the functionality'
8282

83-
Dir.mktmpdir do |dir|
83+
in_tmp_dir do |dir|
8484
output_path = File.join(dir, 'output.po')
8585
dummy_text = <<~PO
8686
msgctxt "key1"
@@ -119,7 +119,7 @@
119119
end
120120

121121
it 'combines the given `release_version` and `release_notes` in a new block, keeps the n-1 ones, and deletes the others' do
122-
Dir.mktmpdir do |dir|
122+
in_tmp_dir do |dir|
123123
output_path = File.join(dir, 'output.po')
124124
dummy_text = <<~PO
125125
msgctxt "release_note_0122"

0 commit comments

Comments
 (0)