test/line_writer_test.rb in iostreams-0.20.3 vs test/line_writer_test.rb in iostreams-1.0.0.beta

- old
+ new

@@ -16,30 +16,30 @@ describe '#<<' do it 'file' do temp_file = Tempfile.new('rocket_job') file_name = temp_file.to_path - IOStreams::Line::Writer.open(file_name) do |io| + IOStreams::Line::Writer.file(file_name) do |io| lines.each { |line| io << line } end result = File.read(file_name) assert_equal raw, result end it 'stream' do io_string = StringIO.new - IOStreams::Line::Writer.open(io_string) do |io| + IOStreams::Line::Writer.stream(io_string) do |io| lines.each { |line| io << line } end assert_equal raw, io_string.string end end describe '.write' do it 'returns byte count' do io_string = StringIO.new count = 0 - IOStreams::Line::Writer.open(io_string) do |io| + IOStreams::Line::Writer.stream(io_string) do |io| lines.each { |line| count += io.write(line) } end assert_equal raw, io_string.string assert_equal raw.size, count end