This commit is contained in:
Petr Korolev 2015-05-26 14:56:49 +03:00
parent 7e941990c4
commit f498e673d1
2 changed files with 20 additions and 10 deletions

View File

@ -5,9 +5,15 @@ describe GitHubChangelogGenerator::Generator do
end
context "when between_tags nil" do
# before(:each) do
# @generator.options = {}
# end
subject do
@generator.instance_variable_set("@options", between_tags: nil)
@generator.get_filtered_tags(%w(1 2 3))
end
it { is_expected.to be_a(Array) }
it { is_expected.to match_array(%w(1 2 3)) }
end
context "when between_tags same as input array" do
subject do
@generator.instance_variable_set("@options", between_tags: %w(1 2 3))
@generator.get_filtered_tags(%w(1 2 3))
@ -16,11 +22,7 @@ describe GitHubChangelogGenerator::Generator do
it { is_expected.to match_array(%w(1 2 3)) }
end
context "when between_tags 1" do
# before(:each) do
# @generator.options = {between_tags: ["1"]}
# end
context "when between_tags filled with correct values" do
subject do
@generator.instance_variable_set("@options", between_tags: %w(1 2))
@generator.get_filtered_tags(%w(1 2 3))
@ -28,5 +30,13 @@ describe GitHubChangelogGenerator::Generator do
it { is_expected.to be_a(Array) }
it { is_expected.to match_array(%w(1 2)) }
end
context "when between_tags filled with invalid values" do
subject do
@generator.instance_variable_set("@options", between_tags: %w(1 q w))
@generator.get_filtered_tags(%w(1 2 3))
end
it { is_expected.to be_a(Array) }
it { is_expected.to match_array(%w(1)) }
end
end
end

View File

@ -1,5 +1,5 @@
describe GitHubChangelogGenerator::Parser do
describe "#self.user_project_from_remote" do
describe ".user_project_from_remote" do
context "when remote is 1" do
subject { GitHubChangelogGenerator::Parser.user_project_from_remote("origin https://github.com/skywinder/ActionSheetPicker-3.0 (fetch)") }
it { is_expected.to be_a(Array) }
@ -26,7 +26,7 @@ describe GitHubChangelogGenerator::Parser do
it { is_expected.to match_array([nil, nil]) }
end
end
describe "#self.user_project_from_option" do
describe ".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