/**
  * @param \Gaufrette\Stream $stream
  */
 function it_writes_to_stream($stream)
 {
     $stream->open(Argument::any())->willReturn(true);
     $stream->write('some content')->shouldBeCalled()->willReturn(12);
     $this->stream_open('gaufrette://some/filename', 'w+');
     $this->stream_write('some content')->shouldReturn(12);
 }
 protected function stream(FileInterface $file, Stream $dst)
 {
     $src = $this->createSourceStream($file);
     // always use reading only for the source
     $this->openStream($src, 'r');
     while (!$src->eof()) {
         $data = $src->read($this->bufferSize);
         $dst->write($data);
     }
     $dst->close();
     $src->close();
 }
 /**
  * @param \Gaufrette\Stream $stream
  */
 function it_should_write_to_stream($stream)
 {
     $stream->write('some content')->shouldBeCalled()->willReturn(12);
     $this->stream_open('gaufrette://some/filename', 'w+');
     $this->stream_write('some content')->shouldReturn(12);
 }