test/test_source.rb in pdd-0.15.2 vs test/test_source.rb in pdd-0.15.3
- old
+ new
@@ -1,9 +1,9 @@
# encoding: utf-8
#
-# Copyright (c) 2014 TechnoPark Corp.
-# Copyright (c) 2014 Yegor Bugayenko
+# Copyright (c) 2014-2016 TechnoPark Corp.
+# Copyright (c) 2014-2016 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -25,13 +25,13 @@
require 'pdd/sources'
require 'tmpdir'
# Source test.
# Author:: Yegor Bugayenko (yegor@teamed.io)
-# Copyright:: Copyright (c) 2014 Yegor Bugayenko
+# Copyright:: Copyright (c) 2014-2016 Yegor Bugayenko
# License:: MIT
-class TestSources < Minitest::Test
+class TestSource < Minitest::Test
def test_parsing
Dir.mktmpdir 'test' do |dir|
file = File.join(dir, 'a.txt')
File.write(
file,
@@ -85,10 +85,11 @@
assert !error.to_s.index('can\'t be parsed').nil?
end
end
def test_failing_on_broken_unicode
+ skip if Gem.win_platform?
Dir.mktmpdir 'test' do |dir|
file = File.join(dir, 'xx.txt')
File.write(file, " * @todo #44 this is a broken unicode: \x92")
assert_raises PDD::Error do
PDD::VerboseSource.new(file, PDD::Source.new(file, 'xx')).puzzles
@@ -112,9 +113,10 @@
assert !error.message.index('Incorrect format').nil?
end
end
def test_reads_git_author
+ skip if Gem.win_platform?
Dir.mktmpdir 'test' do |dir|
fail unless system("
set -e
cd '#{dir}'
git init .