ParserFile: Config format allows empty lines

- defined as: lines that consist only of whitespace
This commit is contained in:
Olle Jonsson 2016-03-19 17:12:30 +01:00
parent 068af037f5
commit 0fccc4396f
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ module GitHubChangelogGenerator
# Returns true if the line starts with a pound sign or a semi-colon.
def non_configuration_line?(line)
line =~ /^[\#;]/
line =~ /^[\#;]/ || line =~ /^[\s]+$/
end
# Returns a the option name as a symbol and its string value sans newlines.

View File

@ -25,8 +25,8 @@ 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") }
context "allows empty lines and comments with semi-colon or pound sign" do
let(:file) { StringIO.new("\n \n# Comment on first line\nunreleased_label=staging\n; Comment on third line\nunreleased=false") }
let(:parser) do
GitHubChangelogGenerator::ParserFile.new(options, file)
end