spec/paperclip/processor_spec.rb in kt-paperclip-5.4.0 vs spec/paperclip/processor_spec.rb in kt-paperclip-6.2.0
- old
+ new
@@ -1,26 +1,26 @@
-require 'spec_helper'
+require "spec_helper"
describe Paperclip::Processor do
it "instantiates and call #make when sent #make to the class" do
- processor = mock
- processor.expects(:make).with()
- Paperclip::Processor.expects(:new).with(:one, :two, :three).returns(processor)
+ processor = double
+ expect(processor).to receive(:make)
+ expect(Paperclip::Processor).to receive(:new).with(:one, :two, :three).and_return(processor)
Paperclip::Processor.make(:one, :two, :three)
end
context "Calling #convert" do
it "runs the convert command with Terrapin" do
Paperclip.options[:log_command] = false
- Terrapin::CommandLine.expects(:new).with("convert", "stuff", {}).returns(stub(:run))
- Paperclip::Processor.new('filename').convert("stuff")
+ expect(Terrapin::CommandLine).to receive(:new).with("convert", "stuff", {}).and_return(double(run: nil))
+ Paperclip::Processor.new("filename").convert("stuff")
end
end
context "Calling #identify" do
it "runs the identify command with Terrapin" do
Paperclip.options[:log_command] = false
- Terrapin::CommandLine.expects(:new).with("identify", "stuff", {}).returns(stub(:run))
- Paperclip::Processor.new('filename').identify("stuff")
+ expect(Terrapin::CommandLine).to receive(:new).with("identify", "stuff", {}).and_return(double(run: nil))
+ Paperclip::Processor.new("filename").identify("stuff")
end
end
end