typekit-client 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +1 -4
- data/bin/typekit +0 -8
- data/lib/typekit.rb +3 -5
- data/lib/typekit/client.rb +28 -21
- data/lib/typekit/core.rb +23 -8
- data/lib/typekit/helper.rb +0 -40
- data/lib/typekit/processing.rb +0 -1
- data/lib/typekit/processing/converter.rb +2 -1
- data/lib/typekit/processing/converter/unknown.rb +2 -1
- data/lib/typekit/processing/translator.rb +6 -9
- data/lib/typekit/record.rb +2 -2
- data/lib/typekit/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/typekit/client_spec.rb +1 -3
- data/spec/typekit/helper_spec.rb +0 -88
- data/spec/typekit/processing/converter_spec.rb +1 -2
- data/spec/typekit/record/base_spec.rb +0 -1
- data/spec/typekit/record_spec.rb +0 -1
- data/typekit-client.gemspec +3 -3
- metadata +18 -41
- data/lib/typekit/configuration.rb +0 -16
- data/lib/typekit/configuration/base.rb +0 -21
- data/lib/typekit/configuration/default.rb +0 -38
- data/lib/typekit/connection.rb +0 -10
- data/lib/typekit/connection/adaptor.rb +0 -13
- data/lib/typekit/connection/adaptor/standard.rb +0 -32
- data/lib/typekit/connection/dispatcher.rb +0 -17
- data/lib/typekit/connection/request.rb +0 -26
- data/lib/typekit/connection/response.rb +0 -16
- data/lib/typekit/processing/parser.rb +0 -14
- data/lib/typekit/processing/parser/json.rb +0 -15
- data/lib/typekit/processing/parser/yaml.rb +0 -15
- data/lib/typekit/routing.rb +0 -9
- data/lib/typekit/routing/mapper.rb +0 -43
- data/lib/typekit/routing/node.rb +0 -5
- data/lib/typekit/routing/node/base.rb +0 -46
- data/lib/typekit/routing/node/collection.rb +0 -34
- data/lib/typekit/routing/node/operation.rb +0 -32
- data/lib/typekit/routing/node/root.rb +0 -8
- data/lib/typekit/routing/node/scope.rb +0 -19
- data/lib/typekit/routing/proxy.rb +0 -17
- data/spec/typekit/configuration_spec.rb +0 -50
- data/spec/typekit/connection/adaptor_spec.rb +0 -24
- data/spec/typekit/connection/dispatcher_spec.rb +0 -36
- data/spec/typekit/connection/request_spec.rb +0 -13
- data/spec/typekit/connection/response_spec.rb +0 -18
- data/spec/typekit/processing/parser_spec.rb +0 -23
- data/spec/typekit/routing/mapper_spec.rb +0 -177
- data/spec/typekit/routing/node_spec.rb +0 -61
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'typekit'
|
3
|
-
|
4
|
-
describe Typekit::Routing::Node do
|
5
|
-
extend RESTHelper
|
6
|
-
|
7
|
-
def create_request(action)
|
8
|
-
# TODO: mock?
|
9
|
-
Typekit::Connection::Request.new(action: action)
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:subject_module) { Typekit::Routing::Node }
|
13
|
-
|
14
|
-
def create_tree(*path)
|
15
|
-
root = subject_module::Root.new
|
16
|
-
path.inject(root) do |parent, name|
|
17
|
-
node = subject_module::Collection.new(name)
|
18
|
-
parent.append(node)
|
19
|
-
node
|
20
|
-
end
|
21
|
-
root
|
22
|
-
end
|
23
|
-
|
24
|
-
describe 'Base#assemble' do
|
25
|
-
let(:root) { create_tree(:kits, :families) }
|
26
|
-
|
27
|
-
shared_examples 'adequate assembler' do
|
28
|
-
let(:request) { create_request(action) }
|
29
|
-
|
30
|
-
it 'builds up Requests' do
|
31
|
-
expect(request).to receive(:<<).
|
32
|
-
exactly(path.size).times.and_call_original
|
33
|
-
root.assemble(request, path)
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'signs Requests' do
|
37
|
-
expect(request).to receive(:sign).
|
38
|
-
with(satisfy { |n| n.match(:families) })
|
39
|
-
root.assemble(request, path)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
restful_collection_actions.each do |action|
|
44
|
-
context "when tracing #{ action } actions" do
|
45
|
-
let(:action) { action }
|
46
|
-
let(:path) { [ :kits, 'xxx', :families ] }
|
47
|
-
|
48
|
-
it_behaves_like 'adequate assembler'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
restful_member_actions.each do |action|
|
53
|
-
context "when tracing #{ action } actions" do
|
54
|
-
let(:action) { action }
|
55
|
-
let(:path) { [ :kits, 'xxx', :families, 'yyy' ] }
|
56
|
-
|
57
|
-
it_behaves_like 'adequate assembler'
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|