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