From ceb1b5f8435049cf8233127e192b44bb19230132 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Sun, 17 Apr 2016 00:06:54 +0200 Subject: [PATCH] Spec: Smaller help functions --- spec/unit/generator/generator_tags_spec.rb | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/spec/unit/generator/generator_tags_spec.rb b/spec/unit/generator/generator_tags_spec.rb index c4aec07..057bb88 100644 --- a/spec/unit/generator/generator_tags_spec.rb +++ b/spec/unit/generator/generator_tags_spec.rb @@ -1,19 +1,14 @@ -def tag_mash_with_name(tag) - mash_tag = Hashie::Mash.new - mash_tag.name = tag - mash_tag -end - -def tags_mash_from_strings(tags_strings) - mash_array = [] - tags_strings.each do |tag| - mash_tag = tag_mash_with_name(tag) - mash_array << mash_tag - end - mash_array -end - describe GitHubChangelogGenerator::Generator do + def tag_mash_with_name(tag) + Hashie::Mash.new.tap {|mash_tag| mash_tag.name = tag } + end + + def tags_mash_from_strings(tags_strings) + tags_strings.map do |tag| + tag_mash_with_name(tag) + end + end + describe "#filter_between_tags" do context "when between_tags nil" do before do