Skip to content

Commit e9e9c31

Browse files
committed
Test the success message on the clean path
Assert the action emits its "No incompatible placeholder changes" success message when nothing changed. Captures `UI.success` (the lane runner emits its own "Driving the lane" message too) and checks ours is among them, so it stays robust to the runner's output. Verified it bites: removing the `report(violations)` call fails this example.
1 parent 02d2167 commit e9e9c31

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

spec/ios_lint_localization_placeholder_changes_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ def lint_placeholder_changes(old:, new:, **extra_params)
3737
expect(result).to eq([])
3838
end
3939

40+
it 'prints a success message when there are no incompatible changes' do
41+
# The lane runner also emits `UI.success` ("Driving the lane …"), so capture all of them and
42+
# assert ours is among them rather than constraining every call.
43+
messages = []
44+
allow(FastlaneCore::UI).to receive(:success) { |m| messages << m }
45+
46+
lint_placeholder_changes(old: '"greeting" = "Hi %@";', new: '"greeting" = "Hello %@";')
47+
48+
expect(messages.join("\n")).to include('No incompatible placeholder changes')
49+
end
50+
4051
it 'reports and aborts when an existing key changes its placeholder type' do
4152
expect(FastlaneCore::UI).to receive(:abort_with_message!)
4253

0 commit comments

Comments
 (0)