test/lib/docparser/output/multi_output_test.rb in docparser-0.2.3 vs test/lib/docparser/output/multi_output_test.rb in docparser-0.3.0

- old
+ new

@@ -1,15 +1,10 @@ +# frozen_string_literal: true + require_relative '../../../test_helper' describe DocParser::MultiOutput do - before do - Log4r::Logger['docparser'].level = Log4r::ERROR - end - after do - Log4r::Logger['docparser'].level = Log4r::INFO - end - it 'must create files' do Dir.mktmpdir do |dir| filename = File.join(dir, 'test') DocParser::MultiOutput.new(filename: filename) @@ -34,32 +29,32 @@ it 'must have a header' do Dir.mktmpdir do |dir| filename = File.join(dir, 'test') output = DocParser::MultiOutput.new(filename: filename) lambda do - output.add_row %w(aap noot mies) + output.add_row %w[aap noot mies] end.must_raise(DocParser::MissingHeaderException) end end it 'must give the correct rowcount' do Dir.mktmpdir do |dir| filename = File.join(dir, 'test') output = DocParser::MultiOutput.new(filename: filename) output.header = 'test', 'the', 'header' output.rowcount.must_equal 0 - output.add_row %w(aap noot mies) - output.add_row %w(aap noot mies) + output.add_row %w[aap noot mies] + output.add_row %w[aap noot mies] output.rowcount.must_equal 2 end end it 'must delegate methods' do Dir.mktmpdir do |dir| filename = File.join(dir, 'test') output = DocParser::MultiOutput.new(filename: filename) - methods = %i(add_row header= close) + methods = %i[add_row header= close] outputs = output.instance_variable_get(:@outputs) outputs.map! do |o| SimpleMock.new o end output.instance_variable_set(:@outputs, outputs) @@ -74,7 +69,6 @@ outputs.map do |o| o.verify.must_equal true end end end - end