Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Also stubbing the new call on Cocaine::CommandLine
Browse files Browse the repository at this point in the history
  • Loading branch information
sikachu committed Sep 23, 2011
1 parent 3a35ba9 commit 0a77f64
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/paperclip_test.rb
Expand Up @@ -2,10 +2,19 @@

class PaperclipTest < Test::Unit::TestCase
context "Calling Paperclip.run" do
should "run the command with Cocaine" do
setup do
Cocaine::CommandLine.expects(:new).with("convert", "stuff").returns(stub(:run))
@original_command_line_path = Cocaine::CommandLine.path
end

teardown do
Cocaine::CommandLine.path = @original_command_line_path
end

should "run the command with Cocaine" do
Paperclip.run("convert", "stuff")
end

should "save Cocaine::CommandLine.path that set before" do
Cocaine::CommandLine.path = "/opt/my_app/bin"
Paperclip.run("convert", "stuff")
Expand Down

0 comments on commit 0a77f64

Please sign in to comment.