Spec: Smaller help functions

This commit is contained in:
Olle Jonsson 2016-04-17 00:06:54 +02:00 committed by Petr Korolev
parent 01a254e412
commit ceb1b5f843

View File

@ -1,19 +1,14 @@
describe GitHubChangelogGenerator::Generator do
def tag_mash_with_name(tag) def tag_mash_with_name(tag)
mash_tag = Hashie::Mash.new Hashie::Mash.new.tap {|mash_tag| mash_tag.name = tag }
mash_tag.name = tag
mash_tag
end end
def tags_mash_from_strings(tags_strings) def tags_mash_from_strings(tags_strings)
mash_array = [] tags_strings.map do |tag|
tags_strings.each do |tag| tag_mash_with_name(tag)
mash_tag = tag_mash_with_name(tag)
mash_array << mash_tag
end end
mash_array
end end
describe GitHubChangelogGenerator::Generator do
describe "#filter_between_tags" do describe "#filter_between_tags" do
context "when between_tags nil" do context "when between_tags nil" do
before do before do