-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fastlane_core] fix the display of non-unicode characters when printi…
…ng lane context (#21857) * [fix] Do not crash when non unicode characters are sent to print * Also test when verbose is on * Move fix into terminal-table gem, and monkey patch it until a new gem ie released
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
describe Fastlane do | ||
describe Fastlane::LaneManagerBase do | ||
describe "#print_lane_context" do | ||
it "prints lane context" do | ||
Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::LANE_NAME] = "test" | ||
|
||
cleaned_row_data = [[:LANE_NAME, "test"]] | ||
|
||
table_data = FastlaneCore::PrintTable.transform_output(cleaned_row_data) | ||
expect(FastlaneCore::PrintTable).to receive(:transform_output).with(cleaned_row_data).and_call_original | ||
expect(Terminal::Table).to receive(:new).with({ | ||
title: "Lane Context".yellow, | ||
rows: table_data | ||
}) | ||
Fastlane::LaneManagerBase.print_lane_context | ||
end | ||
|
||
it "prints lane context" do | ||
Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::LANE_NAME] = "test" | ||
|
||
expect(UI).to receive(:important).with('Lane Context:'.yellow) | ||
expect(UI).to receive(:message).with(Fastlane::Actions.lane_context) | ||
|
||
FastlaneSpec::Env.with_verbose(true) do | ||
Fastlane::LaneManagerBase.print_lane_context | ||
end | ||
end | ||
|
||
it "doesn't crash when lane_context contains non unicode text" do | ||
Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::LANE_NAME] = "test\xAE" | ||
|
||
Fastlane::LaneManagerBase.print_lane_context | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters