add tests for regex
This commit is contained in:
@@ -26,4 +26,20 @@ describe GitHubChangelogGenerator::Parser do
|
||||
it { is_expected.to match_array([nil, nil]) }
|
||||
end
|
||||
end
|
||||
describe "#self.user_project_from_option" do
|
||||
# context "when option is invalid" do
|
||||
# it("should exit") { expect { GitHubChangelogGenerator::Parser.user_project_from_option("blah", nil) }.to raise_error(SystemExit) }
|
||||
# end
|
||||
|
||||
context "when option is valid" do
|
||||
subject { GitHubChangelogGenerator::Parser.user_project_from_option("skywinder/ActionSheetPicker-3.0", nil) }
|
||||
it { is_expected.to be_a(Array) }
|
||||
it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) }
|
||||
end
|
||||
context "when option nil" do
|
||||
subject { GitHubChangelogGenerator::Parser.user_project_from_option(nil, nil) }
|
||||
it { is_expected.to be_a(Array) }
|
||||
it { is_expected.to match_array([nil, nil]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user