test/test_source.rb in pdd-0.18 vs test/test_source.rb in pdd-0.18.1
- old
+ new
@@ -81,11 +81,11 @@
'
)
error = assert_raises PDD::Error do
PDD::VerboseSource.new(file, PDD::Source.new(file, 'ff')).puzzles
end
- assert !error.to_s.index('can\'t be parsed').nil?
+ assert !error.to_s.index('@todo is not followed by a puzzle marker').nil?
end
end
def test_failing_on_broken_unicode
skip if Gem.win_platform?
@@ -110,9 +110,25 @@
)
error = assert_raises PDD::Error do
PDD::VerboseSource.new(file, PDD::Source.new(file, 'hey')).puzzles
end
assert !error.message.index('Incorrect format').nil?
+ end
+ end
+
+ def test_failing_on_puzzle_without_leading_space
+ Dir.mktmpdir 'test' do |dir|
+ file = File.join(dir, 'hey.txt')
+ File.write(
+ file,
+ '
+ *@todo #999 this is an incorrectly formatted puzzle!
+ '
+ )
+ error = assert_raises PDD::Error do
+ PDD::VerboseSource.new(file, PDD::Source.new(file, 'x')).puzzles
+ end
+ assert !error.message.index('@todo must have a leading space').nil?
end
end
def test_reads_git_author
skip if Gem.win_platform?