spec/sftp_spec.rb in carrierwave-ftp-0.2.4 vs spec/sftp_spec.rb in carrierwave-ftp-0.2.5
- old
+ new
@@ -89,9 +89,14 @@
it "returns the size of the file" do
@sftp.should_receive(:stat!).with('/home/test_user/public_html/uploads/test.jpg').and_return(Struct.new(:size).new(14))
@stored.size.should == 14
end
+ it "returns to_file" do
+ @stored.should_receive(:file).and_return(Struct.new(:body).new('some content'))
+ @stored.to_file.size.should == 'some content'.length
+ end
+
it "returns the content of the file" do
@stored.should_receive(:file).and_return(Struct.new(:body).new('some content'))
@stored.read.should == 'some content'
end