pdd 0.14.3 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pdd/source.rb +3 -3
- data/lib/pdd/version.rb +1 -1
- data/test/test_source.rb +10 -0
- metadata +1 -1
data/lib/pdd/source.rb
CHANGED
@@ -46,8 +46,8 @@ module PDD
|
|
46
46
|
re.match(line) do |match|
|
47
47
|
puzzles << puzzle(lines.drop(idx + 1), match, idx)
|
48
48
|
end
|
49
|
-
rescue
|
50
|
-
raise Error, "
|
49
|
+
rescue ArgumentError => ex
|
50
|
+
raise Error, ["in line ##{idx}", ex]
|
51
51
|
end
|
52
52
|
/(.*(?:^|\s))@todo\s+#([\w\-\.:\/]+)/
|
53
53
|
end
|
@@ -138,7 +138,7 @@ module PDD
|
|
138
138
|
def puzzles
|
139
139
|
@source.puzzles
|
140
140
|
rescue Error => ex
|
141
|
-
raise Error, "
|
141
|
+
raise Error, ["in #{@file}", ex]
|
142
142
|
end
|
143
143
|
end
|
144
144
|
end
|
data/lib/pdd/version.rb
CHANGED
data/test/test_source.rb
CHANGED
@@ -70,6 +70,16 @@ class TestSources < Minitest::Test
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
def test_failing_on_broken_unicode
|
74
|
+
Dir.mktmpdir 'test' do |dir|
|
75
|
+
file = File.join(dir, 'xx.txt')
|
76
|
+
File.write(file, " * @todo #44 this is a broken unicode: \x92")
|
77
|
+
assert_raises PDD::Error do
|
78
|
+
PDD::VerboseSource.new(file, PDD::Source.new(file, 'xx')).puzzles
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
73
83
|
def test_failing_on_invalid_puzzle_without_hash_sign
|
74
84
|
skip('doesnt work now')
|
75
85
|
Dir.mktmpdir 'test' do |dir|
|