From 0c61832ee9a36d7594aa4919ac24b474fac0fc0e Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Thu, 27 Jan 2022 21:54:31 +0900 Subject: [PATCH] Use empty StringIO to mocked value in GeometryValidator spec Pass empty StringIO to avoid exception from `ImageSize.new` --- spec/mini_paperclip/validators/geometry_validator_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/mini_paperclip/validators/geometry_validator_spec.rb b/spec/mini_paperclip/validators/geometry_validator_spec.rb index 3ae44e8..e79b261 100644 --- a/spec/mini_paperclip/validators/geometry_validator_spec.rb +++ b/spec/mini_paperclip/validators/geometry_validator_spec.rb @@ -8,7 +8,7 @@ f.binmode mock = double('Record') attachment = double('Attachment') - allow(attachment).to receive(:waiting_write_file).and_return(f) + allow(attachment).to receive(:waiting_write_file).and_return(StringIO.new) expect(mock).to_not receive(:errors) validator.validate_each(mock, :img, attachment) end