ParserFile: Config format allows empty lines
- defined as: lines that consist only of whitespace
This commit is contained in:
parent
068af037f5
commit
0fccc4396f
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user