From 37a7430d811a5c6695a0ccd396520b12949212f1 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Thu, 21 Jul 2016 17:26:53 +0300 Subject: [PATCH] add test --- spec/unit/parser_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/unit/parser_spec.rb b/spec/unit/parser_spec.rb index 4ff4195..2a72767 100644 --- a/spec/unit/parser_spec.rb +++ b/spec/unit/parser_spec.rb @@ -62,4 +62,19 @@ describe GitHubChangelogGenerator::Parser do it { is_expected.to match_array([nil, nil]) } end end + describe ".fetch_user_and_project" do + before :each do + ARGV = ["https://github.com/skywinder/github-changelog-generator"] + end + context do + let(:valid_user) { "initialized_user" } + let(:options) { { user: valid_user } } + let(:options_before_change) { options.dup } + it "should leave user unchanged" do + expect { GitHubChangelogGenerator::Parser.fetch_user_and_project(options) }.to change { options } + .from(options_before_change) + .to(options_before_change.merge(project: "github-changelog-generator")) + end + end + end end