ParserFile: Allow comments in settings file

- Ruby-style or semi-colon-style accepted
This commit is contained in:
Olle Jonsson
2016-03-19 16:42:36 +01:00
parent c5a92b71b2
commit 4569fad479
2 changed files with 17 additions and 1 deletions

View File

@@ -26,6 +26,14 @@ describe GitHubChangelogGenerator::ParserFile do
it { expect { parser.parse! }.to raise_error(/line #2/) }
end
context "allows comments with semi-colon or pound sign" do
let(:file) { StringIO.new("# Comment on first line\nunreleased_label=staging\n; Comment on third line\nunreleased=false") }
let(:parser) do
GitHubChangelogGenerator::ParserFile.new({}, file)
end
it { expect { parser.parse! }.not_to raise_error }
end
context "when override default values" do
let(:default_options) { GitHubChangelogGenerator::Parser.default_options }
let(:options) { {}.merge(default_options) }