Skip to content
Browse files

don't close current stream

  • Loading branch information...
1 parent c05686a commit ad3bc7c52622d669e0fcf32254e83d576a6fc822 Tobias Bielohlawek committed Feb 14, 2012
Showing with 5 additions and 5 deletions.
  1. +0 −1 lib/massive_sitemap/writer/base.rb
  2. +5 −4 spec/writer/file_spec.rb
View
1 lib/massive_sitemap/writer/base.rb
@@ -13,7 +13,6 @@ def initialize(options = {})
# API
def init!(options = {})
- close!
@options.merge!(options)
if init?
@stream = open_stream
View
9 spec/writer/file_spec.rb
@@ -69,10 +69,11 @@
`cat '#{filename}'`.should == "test"
end
- it 'inits new file closes current' do
- writer.print 'test'
- writer.init!(:filename => filename2)
- `cat '#{filename}'`.should == "test"
+ it 'inits new file does not closes current' do
+ expect do
+ writer.print 'test'
+ writer.init!(:filename => filename2)
+ end.to_not change { File.exists?(filename) }
end
it 'writes into second file' do

0 comments on commit ad3bc7c

Please sign in to comment.
Something went wrong with that request. Please try again.