test/lib/docparser/output/multi_output_test.rb in docparser-0.1.2 vs test/lib/docparser/output/multi_output_test.rb in docparser-0.1.3
- old
+ new
@@ -34,31 +34,31 @@
it 'must have a header' do
Dir.mktmpdir do |dir|
filename = File.join(dir, 'test')
output = DocParser::MultiOutput.new(filename: filename)
-> do
- output.add_row ['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 ['aap', 'noot', 'mies']
- output.add_row ['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 = [: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)
\ No newline at end of file