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