add test case

This commit is contained in:
Petr Korolev 2015-06-11 13:09:04 +03:00
parent 8906fe5022
commit 9f1537ab34
2 changed files with 18 additions and 4 deletions

View File

@ -77,4 +77,18 @@ describe GitHubChangelogGenerator::Generator do
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2))) } it { is_expected.to match_array(tags_mash_from_strings(%w(1 2))) }
end end
end end
describe "#get_time_of_tag" do
before(:all) do
@generator = GitHubChangelogGenerator::Generator.new
puts "blah"
end
it "should raise ChangelogGeneratorError" do
expect { @generator.get_time_of_tag nil }.to raise_error(GitHubChangelogGenerator::ChangelogGeneratorError)
end
end
describe "#sort_tags_by_date" do
subject { generator.sort_tags_by_date }
end
end end

View File

@ -1,21 +1,21 @@
describe GitHubChangelogGenerator::Parser do describe GitHubChangelogGenerator::Parser do
describe ".user_project_from_remote" do describe ".user_project_from_remote" do
context "when remote is 1" do context "when remote is type 1" do
subject { GitHubChangelogGenerator::Parser.user_project_from_remote("origin https://github.com/skywinder/ActionSheetPicker-3.0 (fetch)") } subject { GitHubChangelogGenerator::Parser.user_project_from_remote("origin https://github.com/skywinder/ActionSheetPicker-3.0 (fetch)") }
it { is_expected.to be_a(Array) } it { is_expected.to be_a(Array) }
it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) } it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) }
end end
context "when remote is 2" do context "when remote is type 2" do
subject { GitHubChangelogGenerator::Parser.user_project_from_remote("https://github.com/skywinder/ActionSheetPicker-3.0") } subject { GitHubChangelogGenerator::Parser.user_project_from_remote("https://github.com/skywinder/ActionSheetPicker-3.0") }
it { is_expected.to be_a(Array) } it { is_expected.to be_a(Array) }
it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) } it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) }
end end
context "when remote is 3" do context "when remote is type 3" do
subject { GitHubChangelogGenerator::Parser.user_project_from_remote("https://github.com/skywinder/ActionSheetPicker-3.0") } subject { GitHubChangelogGenerator::Parser.user_project_from_remote("https://github.com/skywinder/ActionSheetPicker-3.0") }
it { is_expected.to be_a(Array) } it { is_expected.to be_a(Array) }
it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) } it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) }
end end
context "when remote is 4" do context "when remote is type 4" do
subject { GitHubChangelogGenerator::Parser.user_project_from_remote("origin git@github.com:skywinder/ActionSheetPicker-3.0.git (fetch)") } subject { GitHubChangelogGenerator::Parser.user_project_from_remote("origin git@github.com:skywinder/ActionSheetPicker-3.0.git (fetch)") }
it { is_expected.to be_a(Array) } it { is_expected.to be_a(Array) }
it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) } it { is_expected.to match_array(["skywinder", "ActionSheetPicker-3.0"]) }