-
Notifications
You must be signed in to change notification settings - Fork 9
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 #38 from at-grandpa/0.5.0
0.5.0
- Loading branch information
Showing
71 changed files
with
8,670 additions
and
6,382 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
SPEC_FILES := $(shell find spec -name '*_spec.cr' -print) | ||
SPEC_FILES := $(shell find spec -name '*_spec.cr' -print | sort -n) | ||
|
||
spec: $(SPEC_FILES) | ||
|
||
$(SPEC_FILES): | ||
crystal spec $@ | ||
crystal spec $@ $(SPEC_OPTS) | ||
|
||
.PHONY: spec $(SPEC_FILES) | ||
.PHONY: spec $(SPEC_FILES) |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: clim | ||
version: 0.4.1 | ||
version: 0.5.0 | ||
|
||
authors: | ||
- at-grandpa <@at_grandpa> | ||
|
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,81 @@ | ||
require "./../../spec_helper" | ||
|
||
class SpecCommand < Clim | ||
main do | ||
desc "main command." | ||
usage "main [sub_command] [arguments]" | ||
option "-g WORDS", "--greeting=WORDS", type: String, desc: "Words of greetings.", default: "Hello" | ||
option "-n NAME", type: Array(String), desc: "Target name.", default: ["Taro"], required: true | ||
run do |opts, args| | ||
end | ||
sub "abc" do | ||
desc "abc command." | ||
usage "main abc [tool] [arguments]" | ||
alias_name "def", "ghi" | ||
run do |opts, args| | ||
end | ||
end | ||
sub "abcdef" do | ||
desc "abcdef command." | ||
usage "main abcdef [options] [files]" | ||
alias_name "ghijkl", "mnopqr" | ||
run do |opts, args| | ||
end | ||
end | ||
end | ||
end | ||
|
||
class SpecCommandNoOptions < Clim | ||
main do | ||
desc "main command." | ||
usage "main [sub_command] [arguments]" | ||
run do |opts, args| | ||
end | ||
end | ||
end | ||
|
||
describe Clim::Command::Parser do | ||
describe "#options_help_info" do | ||
it "returns options help info." do | ||
SpecCommand.command.parser.options_help_info.should eq [ | ||
{ | ||
names: ["-g WORDS", "--greeting=WORDS"], | ||
type: String, | ||
desc: "Words of greetings.", | ||
default: "Hello", | ||
required: false, | ||
help_line: " -g WORDS, --greeting=WORDS Words of greetings. [type:String] [default:\"Hello\"]", | ||
}, | ||
{ | ||
names: ["-n NAME"], | ||
type: Array(String), | ||
desc: "Target name.", | ||
default: ["Taro"], | ||
required: true, | ||
help_line: " -n NAME Target name. [type:Array(String)] [default:[\"Taro\"]] [required]", | ||
}, | ||
{ | ||
names: ["--help"], | ||
type: Bool, | ||
desc: "Show this help.", | ||
default: false, | ||
required: false, | ||
help_line: " --help Show this help.", | ||
}, | ||
] | ||
end | ||
it "returns options help info without sub commands." do | ||
SpecCommandNoOptions.command.parser.options_help_info.should eq [ | ||
{ | ||
names: ["--help"], | ||
type: Bool, | ||
desc: "Show this help.", | ||
default: false, | ||
required: false, | ||
help_line: " --help Show this help.", | ||
}, | ||
|
||
] | ||
end | ||
end | ||
end |
Oops, something went wrong.