|
4 | 4 | context ".run" do
|
5 | 5 | before do
|
6 | 6 | Paperclip.options[:log_command] = false
|
7 |
| - Cocaine::CommandLine.expects(:new).with("convert", "stuff", {}).returns(stub(:run)) |
8 |
| - @original_command_line_path = Cocaine::CommandLine.path |
| 7 | + Terrapin::CommandLine.expects(:new).with("convert", "stuff", {}).returns(stub(:run)) |
| 8 | + @original_command_line_path = Terrapin::CommandLine.path |
9 | 9 | end
|
10 | 10 |
|
11 | 11 | after do
|
12 | 12 | Paperclip.options[:log_command] = true
|
13 |
| - Cocaine::CommandLine.path = @original_command_line_path |
| 13 | + Terrapin::CommandLine.path = @original_command_line_path |
14 | 14 | end
|
15 | 15 |
|
16 |
| - it "runs the command with Cocaine" do |
| 16 | + it "runs the command with Terrapin" do |
17 | 17 | Paperclip.run("convert", "stuff")
|
18 | 18 | end
|
19 | 19 |
|
20 |
| - it "saves Cocaine::CommandLine.path that set before" do |
21 |
| - Cocaine::CommandLine.path = "/opt/my_app/bin" |
| 20 | + it "saves Terrapin::CommandLine.path that set before" do |
| 21 | + Terrapin::CommandLine.path = "/opt/my_app/bin" |
22 | 22 | Paperclip.run("convert", "stuff")
|
23 |
| - expect(Cocaine::CommandLine.path).to match("/opt/my_app/bin") |
| 23 | + expect(Terrapin::CommandLine.path).to match("/opt/my_app/bin") |
24 | 24 | end
|
25 | 25 |
|
26 |
| - it "does not duplicate Cocaine::CommandLine.path on multiple runs" do |
27 |
| - Cocaine::CommandLine.expects(:new).with("convert", "more_stuff", {}).returns(stub(:run)) |
28 |
| - Cocaine::CommandLine.path = nil |
| 26 | + it "does not duplicate Terrapin::CommandLine.path on multiple runs" do |
| 27 | + Terrapin::CommandLine.expects(:new).with("convert", "more_stuff", {}).returns(stub(:run)) |
| 28 | + Terrapin::CommandLine.path = nil |
29 | 29 | Paperclip.options[:command_path] = "/opt/my_app/bin"
|
30 | 30 | Paperclip.run("convert", "stuff")
|
31 | 31 | Paperclip.run("convert", "more_stuff")
|
32 | 32 |
|
33 | 33 | cmd_path = Paperclip.options[:command_path]
|
34 |
| - assert_equal 1, Cocaine::CommandLine.path.scan(cmd_path).count |
| 34 | + assert_equal 1, Terrapin::CommandLine.path.scan(cmd_path).count |
35 | 35 | end
|
36 | 36 | end
|
37 | 37 |
|
38 | 38 | it 'does not raise errors when doing a lot of running' do
|
39 | 39 | Paperclip.options[:command_path] = ["/usr/local/bin"] * 1024
|
40 |
| - Cocaine::CommandLine.path = "/something/else" |
| 40 | + Terrapin::CommandLine.path = "/something/else" |
41 | 41 | 100.times do |x|
|
42 | 42 | Paperclip.run("echo", x.to_s)
|
43 | 43 | end
|
|
63 | 63 | context "Calling Paperclip.run with a logger" do
|
64 | 64 | it "passes the defined logger if :log_command is set" do
|
65 | 65 | Paperclip.options[:log_command] = true
|
66 |
| - Cocaine::CommandLine.expects(:new).with("convert", "stuff", logger: Paperclip.logger).returns(stub(:run)) |
| 66 | + Terrapin::CommandLine.expects(:new).with("convert", "stuff", logger: Paperclip.logger).returns(stub(:run)) |
67 | 67 | Paperclip.run("convert", "stuff")
|
68 | 68 | end
|
69 | 69 | end
|
|
0 commit comments