test/test_source.rb in pdd-0.17.9 vs test/test_source.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 @@ -20,10 +18,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. require 'minitest/autorun' require 'tmpdir' +require_relative '../lib/pdd' require_relative '../lib/pdd/sources' # Source test. # Author:: Yegor Bugayenko (yegor256@gmail.com) # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko @@ -47,10 +46,13 @@ assert_equal 2, list.size puzzle = list.first assert_equal '2-3', puzzle.props[:lines] assert_equal 'hello, how are you doing?', puzzle.props[:body] assert_equal '44', puzzle.props[:ticket] + assert puzzle.props[:author].nil? + assert puzzle.props[:email].nil? + assert puzzle.props[:time].nil? end end def test_failing_on_invalid_puzzle Dir.mktmpdir 'test' do |dir| @@ -117,16 +119,15 @@ skip if Gem.win_platform? Dir.mktmpdir 'test' do |dir| raise unless system(" set -e cd '#{dir}' - git init . + git init --quiet . git config user.email test@teamed.io git config user.name test echo '@todo #1 this is the puzzle' > a.txt git add a.txt - git commit -am 'first version' - git blame a.txt + git commit --quiet -am 'first version' ") list = PDD::Source.new(File.join(dir, 'a.txt'), '').puzzles assert_equal 1, list.size puzzle = list.first assert_equal '1-de87adc8', puzzle.props[:id]