spec/integration/csv/writer_spec.rb in dumpster-0.0.1 vs spec/integration/csv/writer_spec.rb in dumpster-0.1.1
- old
+ new
@@ -1,5 +1,6 @@
+# -*- coding: utf-8 -*-
require 'integration/spec_helper'
describe Dumpster::CSV::Writer do
let(:data) { [['col1-row1', 'col2-row1'], ['col1-row2', 'col2-row2']] }
@@ -10,9 +11,13 @@
io = StringIO.new
subject.write_to(io)
io.rewind
io.readlines.should == ["col1-row1,col2-row1\n", "col1-row2,col2-row2\n"]
+ end
+
+ it '#write_to_string gibt die CSV-Daten als String zurück' do
+ subject.write_to_string.should == "col1-row1,col2-row1\ncol1-row2,col2-row2\n"
end
it '#write_to_file schreibt die CSV Daten in eine Datei' do
output_path = File.join(File.dirname(__FILE__), 'output', 'example.csv')