uencode 0.0.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +57 -31
- data/lib/uencode/elements.rb +159 -115
- data/lib/uencode/request.rb +21 -11
- data/lib/uencode/response.rb +20 -14
- data/lib/uencode/version.rb +3 -1
- data/lib/uencode.rb +2 -0
- data/uencode.gemspec +4 -12
- metadata +72 -156
- data/spec/elements_spec.rb +0 -532
- data/spec/fixtures/configuration.yaml +0 -23
- data/spec/fixtures/job_with_one_video_and_no_capture.yml +0 -87
- data/spec/request_spec.rb +0 -53
- data/spec/response_spec.rb +0 -48
- data/spec/spec_helper.rb +0 -16
- data/spec/uencode_spec.rb +0 -14
data/spec/response_spec.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe UEncode::Response do
|
4
|
-
context "errors" do
|
5
|
-
let(:response) { UEncode::Response.new :code => code, :message => "whatever" }
|
6
|
-
|
7
|
-
context "when initialized with a 'BadRequest' code" do
|
8
|
-
let(:code) { 'BadRequest' }
|
9
|
-
|
10
|
-
it "raises a UEncode::Response::BadRequestError error containing the error message" do
|
11
|
-
expect { response }.to raise_error(UEncode::Response::BadRequestError, "whatever")
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
context "when initialized with a 'InvalidKey' code" do
|
16
|
-
let(:code) { 'InvalidKey' }
|
17
|
-
|
18
|
-
it "raises a UEncode::Response::InvalidKeyError containing the error message" do
|
19
|
-
expect { response }.to raise_error(UEncode::Response::InvalidKeyError, "whatever")
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
context "when initialized with a 'NotActive' code" do
|
24
|
-
let(:code) { 'NotActive' }
|
25
|
-
|
26
|
-
it "raises a UEncode::Response::NotActiveError containing the error message" do
|
27
|
-
expect { response }.to raise_error(UEncode::Response::NotActiveError, "whatever")
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context "when initialized with a 'ServerError' code" do
|
32
|
-
let(:code) { 'ServerError' }
|
33
|
-
|
34
|
-
it "raises a UEncode::Response::ServerError containing the error message" do
|
35
|
-
expect { response }.to raise_error(UEncode::Response::ServerError, "whatever")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
context "when initialized with an unknown code" do
|
40
|
-
let(:code) { 'Ffffuuuuu' }
|
41
|
-
|
42
|
-
it "raises a UEncode::Response::UnknownError containing the error code and the error message" do
|
43
|
-
expect { response }.to raise_error(UEncode::Response::UnknownError, "Ffffuuuuu: whatever")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'uencode'
|
2
|
-
require 'rspec'
|
3
|
-
require 'rspec/autorun'
|
4
|
-
require "vcr"
|
5
|
-
|
6
|
-
VCR.config do |c|
|
7
|
-
library_dir = File.join(File.dirname(__FILE__), 'fixtures/')
|
8
|
-
c.cassette_library_dir = library_dir
|
9
|
-
c.stub_with :webmock
|
10
|
-
c.allow_http_connections_when_no_cassette = false
|
11
|
-
c.ignore_localhost = true
|
12
|
-
end
|
13
|
-
|
14
|
-
UEncode.configure do |c|
|
15
|
-
c.customer_key = "1q2w3e4r5t"
|
16
|
-
end
|
data/spec/uencode_spec.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
-
|
4
|
-
require 'spec_helper'
|
5
|
-
|
6
|
-
describe UEncode do
|
7
|
-
it "has a customer_key configuration parameter" do
|
8
|
-
UEncode.configure do |c|
|
9
|
-
c.customer_key = "1234567890"
|
10
|
-
end
|
11
|
-
UEncode.customer_key.should == "1234567890"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|