pdd 0.14.3 → 0.14.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 Error => ex
50
- raise Error, "#{ex.message} in line ##{idx} of #{@path}"
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, "#{ex.message} in #{@file}"
141
+ raise Error, ["in #{@file}", ex]
142
142
  end
143
143
  end
144
144
  end
@@ -26,5 +26,5 @@
26
26
  # Copyright:: Copyright (c) 2014 Yegor Bugayenko
27
27
  # License:: MIT
28
28
  module PDD
29
- VERSION = '0.14.3'
29
+ VERSION = '0.14.4'
30
30
  end
@@ -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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.14.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: