test/test_pdd.rb in pdd-0.17.9 vs test/test_pdd.rb in pdd-0.18
- old
+ new
@@ -1,7 +1,5 @@
-# encoding: utf-8
-#
# Copyright (c) 2014-2017 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
@@ -31,11 +29,11 @@
# Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
# License:: MIT
class TestPDD < Minitest::Test
def test_basic
Dir.mktmpdir 'test' do |dir|
- opts = opts(['-v', '-s', dir, '-e', '**/*.png', '-r', 'max-estimate:15'])
+ opts = opts(['-q', '-s', dir, '-e', '**/*.png', '-r', 'max-estimate:15'])
File.write(File.join(dir, 'a.txt'), '@todo #55 hello!')
matches(
Nokogiri::XML(PDD::Base.new(opts).xml),
[
'/processing-instruction("xml-stylesheet")[contains(.,".xsl")]',
@@ -48,36 +46,36 @@
end
end
def test_rules_failure
Dir.mktmpdir 'test' do |dir|
- opts = opts(['-v', '-s', dir, '-e', '**/*.png', '-r', 'min-estimate:30'])
+ opts = opts(['-q', '-s', dir, '-e', '**/*.png', '-r', 'min-estimate:30'])
File.write(File.join(dir, 'a.txt'), '@todo #90 hello!')
assert_raises PDD::Error do
PDD::Base.new(opts).xml
end
end
end
def test_git_repo
skip if Gem.win_platform?
Dir.mktmpdir 'test' do |dir|
- opts = opts(['-v', '-s', dir])
+ opts = opts(['-q', '-s', dir])
raise unless system("
set -e
cd '#{dir}'
- git init .
+ git init --quiet .
git config user.email test@teamed.io
git config user.name 'Mr. Tester'
mkdir 'a long dir name'
cd 'a long dir name'
mkdir 'a kid'
cd 'a kid'
- echo '@todo #1 this is the puzzle' > '.это файл.txt'
+ echo '@todo #1 this is some puzzle' > '.это файл.txt'
cd ../..
git add -f .
- git commit -am 'first version'
+ git commit --quiet -am 'first version'
")
matches(
Nokogiri::XML(PDD::Base.new(opts).xml),
[
'/puzzles[count(puzzle)=1]',
@@ -94,9 +92,10 @@
private
def opts(args)
Slop.parse args do |o|
o.bool '-v', '--verbose'
+ o.bool '-q', '--quiet'
o.string '-s', '--source'
o.array '-e', '--exclude'
o.array '-r', '--rule'
end
end