typekit-client 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.md +1 -4
  4. data/bin/typekit +0 -8
  5. data/lib/typekit.rb +3 -5
  6. data/lib/typekit/client.rb +28 -21
  7. data/lib/typekit/core.rb +23 -8
  8. data/lib/typekit/helper.rb +0 -40
  9. data/lib/typekit/processing.rb +0 -1
  10. data/lib/typekit/processing/converter.rb +2 -1
  11. data/lib/typekit/processing/converter/unknown.rb +2 -1
  12. data/lib/typekit/processing/translator.rb +6 -9
  13. data/lib/typekit/record.rb +2 -2
  14. data/lib/typekit/version.rb +1 -1
  15. data/spec/spec_helper.rb +1 -0
  16. data/spec/typekit/client_spec.rb +1 -3
  17. data/spec/typekit/helper_spec.rb +0 -88
  18. data/spec/typekit/processing/converter_spec.rb +1 -2
  19. data/spec/typekit/record/base_spec.rb +0 -1
  20. data/spec/typekit/record_spec.rb +0 -1
  21. data/typekit-client.gemspec +3 -3
  22. metadata +18 -41
  23. data/lib/typekit/configuration.rb +0 -16
  24. data/lib/typekit/configuration/base.rb +0 -21
  25. data/lib/typekit/configuration/default.rb +0 -38
  26. data/lib/typekit/connection.rb +0 -10
  27. data/lib/typekit/connection/adaptor.rb +0 -13
  28. data/lib/typekit/connection/adaptor/standard.rb +0 -32
  29. data/lib/typekit/connection/dispatcher.rb +0 -17
  30. data/lib/typekit/connection/request.rb +0 -26
  31. data/lib/typekit/connection/response.rb +0 -16
  32. data/lib/typekit/processing/parser.rb +0 -14
  33. data/lib/typekit/processing/parser/json.rb +0 -15
  34. data/lib/typekit/processing/parser/yaml.rb +0 -15
  35. data/lib/typekit/routing.rb +0 -9
  36. data/lib/typekit/routing/mapper.rb +0 -43
  37. data/lib/typekit/routing/node.rb +0 -5
  38. data/lib/typekit/routing/node/base.rb +0 -46
  39. data/lib/typekit/routing/node/collection.rb +0 -34
  40. data/lib/typekit/routing/node/operation.rb +0 -32
  41. data/lib/typekit/routing/node/root.rb +0 -8
  42. data/lib/typekit/routing/node/scope.rb +0 -19
  43. data/lib/typekit/routing/proxy.rb +0 -17
  44. data/spec/typekit/configuration_spec.rb +0 -50
  45. data/spec/typekit/connection/adaptor_spec.rb +0 -24
  46. data/spec/typekit/connection/dispatcher_spec.rb +0 -36
  47. data/spec/typekit/connection/request_spec.rb +0 -13
  48. data/spec/typekit/connection/response_spec.rb +0 -18
  49. data/spec/typekit/processing/parser_spec.rb +0 -23
  50. data/spec/typekit/routing/mapper_spec.rb +0 -177
  51. 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