Skip to content

Commit 570d1a2

Browse files
author
Pedro Coelho
committed
Adding the finish method to Job so it can finish live streaming jobs
1 parent 57bb2fd commit 570d1a2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Diff for: lib/zencoder/job.rb

+4
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,9 @@ def self.cancel(job_id, options={})
3030
put("/jobs/#{job_id}/cancel", nil, options)
3131
end
3232

33+
def self.finish(job_id, options={})
34+
put("/jobs/#{job_id}/finish", nil, options)
35+
end
36+
3337
end
3438
end

Diff for: test/zencoder/job_test.rb

+12
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,17 @@ class Zencoder::JobTest < Test::Unit::TestCase
101101
end
102102
end
103103

104+
context ".finish" do
105+
setup do
106+
@job_id = 1
107+
@url = "#{Zencoder.base_url}/jobs/#{@job_id}/finish"
108+
end
109+
110+
should "PUT the correct url and return a response" do
111+
Zencoder::HTTP.stubs(:put).with(@url, nil, :headers => {"Zencoder-Api-Key" => @api_key}).returns(Zencoder::Response.new)
112+
assert_equal Zencoder::Response, Zencoder::Job.finish(1, :api_key => @api_key).class
113+
end
114+
end
115+
104116
end
105117
end

0 commit comments

Comments
 (0)