Skip to content

Commit ba0fdc6

Browse files
committed
Add comments to provide additional explanations
h/t @mokagio in #331 (comment)
1 parent fd67884 commit ba0fdc6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/ios_download_strings_files_from_glotpress_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def test_gp_download(filters:, tablename:, expected_gp_params:)
1818
stub_zh = gp_stub(locale: 'zh-cn', query: expected_gp_params).to_return(body: '"key" = "zh-copy";')
1919

2020
# Act
21+
# Note: The use of `.compact` here allows us to remove the keys (like `table_basename` and `filters`) from the `Hash` whose values are `nil`,
22+
# so that we don't include those parameters at all in the action's call site -- making them use the default value from their respective
23+
# `ConfigItem` (as opposed to passing a value of `nil` explicitly and overwrite the default value, which is not what we want to test).
2124
run_described_fastlane_action({
2225
project_url: gp_fake_url,
2326
locales: locales_subset,
@@ -96,6 +99,7 @@ def test_gp_download(filters:, tablename:, expected_gp_params:)
9699
end
97100

98101
# Assert
102+
# Note: FastlaneError is the exception raised by UI.user_error!
99103
expect { act.call }.to raise_error(FastlaneCore::Interface::FastlaneError, "The parent directory `#{download_dir}` (which contains all the `*.lproj` subdirectories) must already exist")
100104
end
101105

0 commit comments

Comments
 (0)