Skip to content

Commit 78900d2

Browse files
author
Branden Conley
committed
Explicitly passing MaximumDisplayWidth = 80 to tests that fail unless your Maximum Display Width is 80
1 parent c363001 commit 78900d2

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Diff for: tests/CommandLine.Tests/Unit/ParserTests.cs

+15-3
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,11 @@ public void Properly_formatted_help_screen_is_displayed_when_usage_is_defined_in
490490
{
491491
// Fixture setup
492492
var help = new StringWriter();
493-
var sut = new Parser(config => config.HelpWriter = help);
493+
var sut = new Parser(config =>
494+
{
495+
config.HelpWriter = help;
496+
config.MaximumDisplayWidth = 80;
497+
});
494498

495499
// Exercize system
496500
sut.ParseArguments<Add_Verb_With_Usage_Attribute, Commit_Verb_With_Usage_Attribute, Clone_Verb_With_Usage_Attribute>(
@@ -628,7 +632,11 @@ public void Specific_verb_help_screen_should_be_displayed_regardless_other_argum
628632
{
629633
// Fixture setup
630634
var help = new StringWriter();
631-
var sut = new Parser(config => config.HelpWriter = help);
635+
var sut = new Parser(config =>
636+
{
637+
config.HelpWriter = help;
638+
config.MaximumDisplayWidth = 80;
639+
});
632640

633641
// Exercize system
634642
sut.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb>(
@@ -698,7 +706,11 @@ public void Properly_formatted_help_screen_excludes_help_as_unknown_option()
698706
{
699707
// Fixture setup
700708
var help = new StringWriter();
701-
var sut = new Parser(config => config.HelpWriter = help);
709+
var sut = new Parser(config =>
710+
{
711+
config.HelpWriter = help;
712+
config.MaximumDisplayWidth = 80;
713+
});
702714

703715
// Exercize system
704716
sut.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb>(

Diff for: tests/CommandLine.Tests/Unit/Text/HelpTextTests.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void Create_instance_with_enum_options_enabled()
7878
{
7979
// Fixture setup
8080
// Exercize system
81-
var sut = new HelpText { AddDashesToOption = true, AddEnumValuesToHelpText = true }
81+
var sut = new HelpText { AddDashesToOption = true, AddEnumValuesToHelpText = true, MaximumDisplayWidth = 80 }
8282
.AddPreOptionsLine("pre-options")
8383
.AddOptions(new NotParsed<Options_With_Enum_Having_HelpText>(TypeInfo.Create(typeof(Options_With_Enum_Having_HelpText)), Enumerable.Empty<Error>()))
8484
.AddPostOptionsLine("post-options");
@@ -184,6 +184,7 @@ public void When_help_text_has_hidden_option_it_should_not_be_added_to_help_text
184184
// Fixture setup
185185
// Exercize system
186186
var sut = new HelpText(new HeadingInfo("CommandLine.Tests.dll", "1.9.4.131"));
187+
sut.MaximumDisplayWidth = 80;
187188
sut.AddOptions(
188189
new NotParsed<Simple_Options_With_HelpText_Set_To_Long_Description>(
189190
TypeInfo.Create(typeof(Simple_Options_With_HelpText_Set_To_Long_Description)),

0 commit comments

Comments
 (0)