test/lib/docparser/output/xlsx_output_test.rb in docparser-0.2.3 vs test/lib/docparser/output/xlsx_output_test.rb in docparser-0.3.0
- old
+ new
@@ -1,15 +1,10 @@
+# frozen_string_literal: true
+
require_relative '../../../test_helper'
describe DocParser::XLSXOutput do
- before do
- Log4r::Logger['docparser'].level = Log4r::ERROR
- end
- after do
- Log4r::Logger['docparser'].level = Log4r::INFO
- end
-
it 'must create a file' do
Dir.mktmpdir do |dir|
filename = File.join(dir, 'test.xlsx')
DocParser::XLSXOutput.new(filename: filename)
File.exist?(filename).must_equal true
@@ -29,11 +24,11 @@
it 'must save some rows' do
Dir.mktmpdir do |dir|
filename = File.join(dir, 'test.xlsx')
output = DocParser::XLSXOutput.new(filename: filename)
- output.add_row %w(aap noot mies)
+ output.add_row %w[aap noot mies]
output.add_row ['aap', 'noot', 'mies;']
output.close
sheet = output.instance_variable_get(:@sheet)
sheet.rows.length.must_equal(2)
end
@@ -43,11 +38,11 @@
Dir.mktmpdir do |dir|
filename = File.join(dir, 'test.xlsx')
output = DocParser::XLSXOutput.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
end