typekit-client 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -3
- data/.travis.yml +4 -0
- data/.yardopts +6 -0
- data/CHANGELOG.md +12 -0
- data/Guardfile +21 -3
- data/README.md +253 -248
- data/bin/typekit-client +16 -16
- data/bin/typekit-publisher +6 -5
- data/lib/typekit.rb +6 -2
- data/lib/typekit/client.rb +66 -24
- data/lib/typekit/collection.rb +6 -11
- data/lib/typekit/collection/base.rb +40 -0
- data/lib/typekit/collection/serialization.rb +17 -0
- data/lib/typekit/converter.rb +26 -0
- data/lib/typekit/converter/boolean.rb +12 -0
- data/lib/typekit/converter/collection.rb +13 -0
- data/lib/typekit/converter/datetime.rb +12 -0
- data/lib/typekit/converter/element.rb +13 -0
- data/lib/typekit/converter/errors.rb +12 -0
- data/lib/typekit/converter/unknown.rb +13 -0
- data/lib/typekit/core.rb +8 -10
- data/lib/typekit/element.rb +27 -0
- data/lib/typekit/element/association.rb +63 -0
- data/lib/typekit/element/base.rb +61 -0
- data/lib/typekit/element/persistence.rb +61 -0
- data/lib/typekit/element/query.rb +25 -0
- data/lib/typekit/element/serialization.rb +17 -0
- data/lib/typekit/error.rb +23 -0
- data/lib/typekit/helper.rb +59 -10
- data/lib/typekit/record.rb +18 -22
- data/lib/typekit/record/family.rb +24 -1
- data/lib/typekit/record/kit.rb +29 -1
- data/lib/typekit/record/library.rb +4 -1
- data/lib/typekit/record/variation.rb +13 -1
- data/lib/typekit/version.rb +1 -1
- data/spec/feature/create_kit_spec.rb +52 -0
- data/spec/feature/delete_kit_spec.rb +33 -0
- data/spec/feature/index_kits_spec.rb +55 -0
- data/spec/feature/publish_kit_spec.rb +15 -0
- data/spec/feature/show_family_spec.rb +75 -0
- data/spec/feature/show_kit_spec.rb +56 -0
- data/spec/feature/show_library_spec.rb +29 -0
- data/spec/feature/show_variation_spec.rb +18 -0
- data/spec/feature/update_kit_spec.rb +88 -0
- data/spec/fixture/cassette/create_kits_bad.yml +16 -0
- data/spec/fixture/cassette/create_kits_ok.yml +16 -0
- data/spec/fixture/cassette/delete_kits_xxx_not_found.yml +13 -0
- data/spec/{cassettes → fixture/cassette}/delete_kits_xxx_ok.yml +0 -3
- data/spec/fixture/cassette/index_kits_show_kit_xxx_ok.yml +25 -0
- data/spec/{cassettes → fixture/cassette}/index_kits_unauthorized.yml +0 -3
- data/spec/{cassettes → fixture/cassette}/show_families_xxx_found.yml +0 -3
- data/spec/{cassettes → fixture/cassette}/show_families_xxx_ok.yml +0 -3
- data/spec/{cassettes → fixture/cassette}/show_families_xxx_yyy_ok.yml +0 -3
- data/spec/fixture/cassette/show_families_yyy_update_kits_xxx_families_ok.yml +35 -0
- data/spec/fixture/cassette/show_kits_xxx_families_yyy_show_family_yyy_ok.yml +45 -0
- data/spec/fixture/cassette/show_kits_xxx_not_found.yml +13 -0
- data/spec/fixture/cassette/show_kits_xxx_show_family_yyy_ok.yml +46 -0
- data/spec/{cassettes → fixture/cassette}/show_libraries_xxx_ok.yml +0 -3
- data/spec/fixture/cassette/update_kits_xxx_empty_families_ok.yml +16 -0
- data/spec/fixture/cassette/update_kits_xxx_families_ok.yml +18 -0
- data/spec/fixture/cassette/update_kits_xxx_families_variations_ok.yml +18 -0
- data/spec/fixture/cassette/update_kits_xxx_name_ok.yml +17 -0
- data/spec/fixture/cassette/update_kits_xxx_publish_ok.yml +16 -0
- data/spec/fixture/record/article.rb +11 -0
- data/spec/fixture/record/section.rb +10 -0
- data/spec/lib/typekit/collection_spec.rb +22 -0
- data/spec/{typekit/processing → lib/typekit}/converter_spec.rb +13 -13
- data/spec/lib/typekit/element/association_spec.rb +96 -0
- data/spec/lib/typekit/element/base_spec.rb +70 -0
- data/spec/lib/typekit/element/persistence_spec.rb +97 -0
- data/spec/lib/typekit/element/serialization_spec.rb +28 -0
- data/spec/lib/typekit/element_spec.rb +58 -0
- data/spec/{typekit → lib/typekit}/helper_spec.rb +6 -8
- data/spec/lib/typekit/record_spec.rb +57 -0
- data/spec/spec_helper.rb +10 -3
- data/spec/support/common_helper.rb +5 -0
- data/spec/support/record_helper.rb +38 -0
- data/typekit-client.gemspec +11 -4
- metadata +164 -58
- data/lib/typekit/processing.rb +0 -8
- data/lib/typekit/processing/converter.rb +0 -28
- data/lib/typekit/processing/converter/boolean.rb +0 -14
- data/lib/typekit/processing/converter/collection.rb +0 -18
- data/lib/typekit/processing/converter/datetime.rb +0 -14
- data/lib/typekit/processing/converter/errors.rb +0 -24
- data/lib/typekit/processing/converter/record.rb +0 -16
- data/lib/typekit/processing/converter/unknown.rb +0 -15
- data/lib/typekit/processing/translator.rb +0 -13
- data/lib/typekit/record/base.rb +0 -52
- data/spec/cassettes/index_kits_ok.yml +0 -16
- data/spec/cassettes/show_kits_xxx_families_yyy_ok.yml +0 -16
- data/spec/cassettes/show_kits_xxx_ok.yml +0 -17
- data/spec/features/client/delete_kit_spec.rb +0 -13
- data/spec/features/client/index_kits_spec.rb +0 -25
- data/spec/features/client/show_family_spec.rb +0 -47
- data/spec/features/client/show_kit_spec.rb +0 -18
- data/spec/features/client/show_library_spec.rb +0 -18
- data/spec/features/client/show_variation_spec.rb +0 -22
- data/spec/support/resource_helper.rb +0 -34
- data/spec/typekit/record/base_spec.rb +0 -85
- data/spec/typekit/record_spec.rb +0 -80
data/spec/typekit/record_spec.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.describe Typekit::Record do
|
4
|
-
include ResourceHelper
|
5
|
-
extend ResourceHelper
|
6
|
-
|
7
|
-
let(:subject_module) { Typekit::Record }
|
8
|
-
|
9
|
-
describe '.mapping' do
|
10
|
-
it 'returns a hash whose keys are the names of the resources' do
|
11
|
-
expect(subject_module.mapping.keys).to \
|
12
|
-
contain_exactly(*record_symbols)
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'returns a hash whose values are the classes of the resources' do
|
16
|
-
expect(subject_module.mapping.values).to \
|
17
|
-
contain_exactly(*record_classes)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '.classify' do
|
22
|
-
record_mapping.each do |name, klass|
|
23
|
-
it "converts :#{ name } into the corresponding Record class" do
|
24
|
-
expect(subject_module.classify(name)).to eq(klass)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "converts '#{ name }' into the corresponding Record class" do
|
28
|
-
expect(subject_module.classify(name.to_s)).to eq(klass)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
collection_mapping.each do |name, klass|
|
33
|
-
it "converts :#{ name } into the corresponding Record class" do
|
34
|
-
expect(subject_module.classify(name)).to eq(klass)
|
35
|
-
end
|
36
|
-
|
37
|
-
it "converts '#{ name }' into the corresponding Record class" do
|
38
|
-
expect(subject_module.classify(name.to_s)).to eq(klass)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'returns nil for unknown names' do
|
43
|
-
expect(subject_module.classify('smile')).to be nil
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'returns nil for nil' do
|
47
|
-
expect(subject_module.classify(nil)).to be nil
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe '.identify' do
|
52
|
-
record_mapping.each do |name, klass|
|
53
|
-
it "converts :#{ name } into :record" do
|
54
|
-
expect(subject_module.identify(name)).to eq(:record)
|
55
|
-
end
|
56
|
-
|
57
|
-
it "converts '#{ name }' into :record" do
|
58
|
-
expect(subject_module.identify(name.to_s)).to eq(:record)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
collection_mapping.each do |name, klass|
|
63
|
-
it "converts :#{ name } into :collection" do
|
64
|
-
expect(subject_module.identify(name)).to eq(:collection)
|
65
|
-
end
|
66
|
-
|
67
|
-
it "converts '#{ name }' into :collection" do
|
68
|
-
expect(subject_module.identify(name.to_s)).to eq(:collection)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'returns nil for unknown names' do
|
73
|
-
expect(subject_module.identify('smile')).to be nil
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'returns nil for nil' do
|
77
|
-
expect(subject_module.identify(nil)).to be nil
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|