-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1630 from eggplants/chore/capitalize-descriptions…
…-shown-in-cli-help Capitalize descriptions shown in CLI help
- Loading branch information
Showing
3 changed files
with
58 additions
and
20 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
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
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,38 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
module Tapioca | ||
class HelpSpec < SpecWithProject | ||
describe("cli::help") do | ||
before(:all) do | ||
project.bundle_install | ||
end | ||
|
||
it "must display the help when passing --help" do | ||
result = @project.tapioca("--help") | ||
stdout_lines = result.out.strip.split("\n") | ||
assert_equal("Commands:", stdout_lines.first) | ||
assert_empty_stderr(result) | ||
assert_success_status(result) | ||
end | ||
|
||
it "must display the help when passing -h" do | ||
result = @project.tapioca("-h") | ||
stdout_lines = result.out.strip.split("\n") | ||
assert_equal("Commands:", stdout_lines.first) | ||
assert_empty_stderr(result) | ||
assert_success_status(result) | ||
end | ||
|
||
it "must begin every command description of help text with a capital letter" do | ||
result = @project.tapioca("--help") | ||
stdout_lines = result.out.strip.split("\n") | ||
assert_equal(stdout_lines.reject { / # [a-z]/.match?(_1) }.size, stdout_lines.size) | ||
assert_empty_stderr(result) | ||
assert_success_status(result) | ||
end | ||
end | ||
end | ||
end |