refuct
This commit is contained in:
parent
f498e673d1
commit
957fa0d3a3
|
@ -1,21 +1,21 @@
|
||||||
describe GitHubChangelogGenerator::Generator do
|
describe GitHubChangelogGenerator::Generator do
|
||||||
describe "#get_filtered_tags" do
|
describe "#get_filtered_tags" do
|
||||||
before(:all) do
|
|
||||||
@generator = GitHubChangelogGenerator::Generator.new
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when between_tags nil" do
|
context "when between_tags nil" do
|
||||||
|
before do
|
||||||
|
@generator = GitHubChangelogGenerator::Generator.new(between_tags: nil)
|
||||||
|
end
|
||||||
|
|
||||||
subject do
|
subject do
|
||||||
@generator.instance_variable_set("@options", between_tags: nil)
|
|
||||||
@generator.get_filtered_tags(%w(1 2 3))
|
@generator.get_filtered_tags(%w(1 2 3))
|
||||||
end
|
end
|
||||||
it { is_expected.to be_a(Array) }
|
it { is_expected.to be_a(Array) }
|
||||||
it { is_expected.to match_array(%w(1 2 3)) }
|
it { is_expected.to match_array(%w(1 2 3)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when between_tags same as input array" do
|
context "when between_tags same as input array" do
|
||||||
|
before do
|
||||||
|
@generator = GitHubChangelogGenerator::Generator.new(between_tags: %w(1 2 3))
|
||||||
|
end
|
||||||
subject do
|
subject do
|
||||||
@generator.instance_variable_set("@options", between_tags: %w(1 2 3))
|
|
||||||
@generator.get_filtered_tags(%w(1 2 3))
|
@generator.get_filtered_tags(%w(1 2 3))
|
||||||
end
|
end
|
||||||
it { is_expected.to be_a(Array) }
|
it { is_expected.to be_a(Array) }
|
||||||
|
@ -23,16 +23,22 @@ describe GitHubChangelogGenerator::Generator do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when between_tags filled with correct values" do
|
context "when between_tags filled with correct values" do
|
||||||
|
before do
|
||||||
|
@generator = GitHubChangelogGenerator::Generator.new(between_tags: %w(1 2))
|
||||||
|
end
|
||||||
subject do
|
subject do
|
||||||
@generator.instance_variable_set("@options", between_tags: %w(1 2))
|
|
||||||
@generator.get_filtered_tags(%w(1 2 3))
|
@generator.get_filtered_tags(%w(1 2 3))
|
||||||
end
|
end
|
||||||
it { is_expected.to be_a(Array) }
|
it { is_expected.to be_a(Array) }
|
||||||
it { is_expected.to match_array(%w(1 2)) }
|
it { is_expected.to match_array(%w(1 2)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when between_tags filled with invalid values" do
|
context "when between_tags filled with invalid values" do
|
||||||
|
before do
|
||||||
|
@generator = GitHubChangelogGenerator::Generator.new(between_tags: %w(1 q w))
|
||||||
|
end
|
||||||
|
|
||||||
subject do
|
subject do
|
||||||
@generator.instance_variable_set("@options", between_tags: %w(1 q w))
|
|
||||||
@generator.get_filtered_tags(%w(1 2 3))
|
@generator.get_filtered_tags(%w(1 2 3))
|
||||||
end
|
end
|
||||||
it { is_expected.to be_a(Array) }
|
it { is_expected.to be_a(Array) }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user