tacokit 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +86 -0
- data/.travis.yml +6 -0
- data/Gemfile +16 -25
- data/Guardfile +1 -1
- data/README.md +61 -17
- data/Rakefile +10 -5
- data/lib/tacokit/authorization.rb +14 -13
- data/lib/tacokit/client/actions.rb +68 -28
- data/lib/tacokit/client/boards.rb +92 -85
- data/lib/tacokit/client/cards.rb +285 -92
- data/lib/tacokit/client/checklists.rb +48 -28
- data/lib/tacokit/client/labels.rb +14 -16
- data/lib/tacokit/client/lists.rb +52 -28
- data/lib/tacokit/client/members.rb +56 -46
- data/lib/tacokit/client/notifications.rb +13 -27
- data/lib/tacokit/client/organizations.rb +0 -6
- data/lib/tacokit/client/searches.rb +0 -1
- data/lib/tacokit/client/tokens.rb +0 -6
- data/lib/tacokit/client/types.rb +0 -1
- data/lib/tacokit/client/webhooks.rb +3 -8
- data/lib/tacokit/client.rb +48 -75
- data/lib/tacokit/collection.rb +49 -0
- data/lib/tacokit/configuration.rb +4 -6
- data/lib/tacokit/error.rb +0 -2
- data/lib/tacokit/middleware/boom.rb +6 -7
- data/lib/tacokit/middleware.rb +2 -10
- data/lib/tacokit/resource.rb +84 -57
- data/lib/tacokit/response.rb +3 -3
- data/lib/tacokit/transform.rb +35 -13
- data/lib/tacokit/utils.rb +40 -8
- data/lib/tacokit/version.rb +1 -1
- data/lib/tacokit.rb +0 -2
- data/spec/cassettes/Tacokit_Client_Actions/_action_board/returns_action_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Actions/_action_card/returns_action_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Actions/_action_entities/returns_action_entities.json +1 -0
- data/spec/cassettes/Tacokit_Client_Actions/_action_list/returns_action_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_add_board_member/adds_invites_member_to_board.json +1 -1
- data/spec/cassettes/Tacokit_Client_Boards/_board_actions/returns_board_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_cards/returns_board_cards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_checklists/returns_board_checklists.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_labels/returns_board_labels.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_lists/returns_board_lists.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_members/returns_board_members.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_organization/returns_board_organization.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_preferences/returns_preferences_for_a_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_board_stars/returns_board_stars.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_member_board_stars/returns_board_stars.json +1 -0
- data/spec/cassettes/Tacokit_Client_Boards/_update_board_member/updates_member.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_add_comment/creates_a_comment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_add_label/adds_label_to_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_add_member_to_card/adds_member_to_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_archive_card/archives_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_archive_card/restore_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_an_attachment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_attachments/returns_attachments.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_card_resource.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_id.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card/returns_a_card_by_short_link.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_actions/returns_card_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_board/returns_card_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_a_hash.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_a_value.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_field/returns_an_array.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_list/returns_a_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_members/returns_members_voted.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_actions.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_board.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_resource/returns_card_check_item_states.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_card_stickers/returns_.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_check_item_states.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_checklists/returns_checklists.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_create_card/creates_a_card.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/attaches_external_url.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_create_card_attachment/uploads_local_file.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_card/deletes_a_card.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_card_resource/deletes_resource.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_delete_comment/deletes_comment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_list/returns_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_a_new_position.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_another_board_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/moves_card_to_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_move_card/raises_error_if_missing_options.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_a_checklist_item.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/adds_new_checklist_by_name.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_start_checklist/copies_a_checklist_by_id.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_stickers/returns_stickers.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_update_card/updates_a_card.json +1 -1
- data/spec/cassettes/Tacokit_Client_Cards/_update_checklist_item/updates_checklist_item.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_update_comment/updates_a_comment.json +1 -0
- data/spec/cassettes/Tacokit_Client_Cards/_vote/adds_a_member_s_vote_to_card.json +1 -0
- data/spec/cassettes/Tacokit_Client_Checklists/_check_items/adds_a_checklist_check_item.json +1 -0
- data/spec/cassettes/Tacokit_Client_Checklists/_check_items/retrieves_checklist_check_items.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_archive_list_cards/should_archive_cards_in_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_list_actions/returns_list_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_list_board/returns_list_board.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_list_cards/returns_list_cards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Lists/_move_list_cards/should_move_cards_in_list.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_actions/returns_member_actions.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_board_stars/returns_member_board_stars.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_boards/returns_member_boards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_cards/returns_member_cards.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_notifications/returns_member_notifications.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_organizations/returns_member_organizations.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_organizations.json +1 -0
- data/spec/cassettes/Tacokit_Client_Members/_tokens/returns_member_tokens.json +1 -0
- data/spec/spec_helper.rb +39 -29
- data/spec/tacokit/authorization_spec.rb +11 -11
- data/spec/tacokit/client/actions_spec.rb +56 -19
- data/spec/tacokit/client/boards_spec.rb +81 -78
- data/spec/tacokit/client/cards_spec.rb +322 -68
- data/spec/tacokit/client/checklists_spec.rb +29 -27
- data/spec/tacokit/client/labels_spec.rb +8 -16
- data/spec/tacokit/client/lists_spec.rb +74 -27
- data/spec/tacokit/client/members_spec.rb +55 -41
- data/spec/tacokit/client/notifications_spec.rb +3 -31
- data/spec/tacokit/client/organizations_spec.rb +6 -27
- data/spec/tacokit/client/searches_spec.rb +1 -3
- data/spec/tacokit/client/tokens_spec.rb +2 -18
- data/spec/tacokit/client/types_spec.rb +2 -3
- data/spec/tacokit/client/webhooks_spec.rb +6 -14
- data/spec/tacokit/client_spec.rb +3 -3
- data/spec/tacokit/configuration_spec.rb +30 -31
- data/spec/tacokit/middleware/boom_spec.rb +6 -7
- data/spec/tacokit/resource_spec.rb +142 -17
- data/spec/tacokit/transform_spec.rb +37 -35
- data/spec/tacokit_spec.rb +3 -5
- data/tacokit.gemspec +6 -6
- metadata +132 -15
- data/config.ru +0 -7
- data/lib/tacokit/middleware/debug.rb +0 -22
- data/spec/cassettes/Tacokit_Client_Boards/_update_board_resource/updates_member.json +0 -1
- data/spec/cassettes/Tacokit_Client_Members/_member/raises_error_for_missing_token.json +0 -1
@@ -1,26 +1,151 @@
|
|
1
|
-
require
|
2
|
-
require 'ostruct'
|
1
|
+
require "spec_helper"
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
module Tacokit
|
4
|
+
describe Resource do
|
5
|
+
describe "#initialize" do
|
6
|
+
it "handles given attributes" do
|
7
|
+
res = Resource.new one: "one", "two" => :two
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
expect(res).to be_a(Resource)
|
10
|
+
expect(res.one).to eq "one"
|
11
|
+
expect(res.two).to eq :two
|
12
|
+
end
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
resource = build_resource(one: 'one', 'two' => :two)
|
14
|
+
it "handles nested objects" do
|
15
|
+
res = Resource.new prefs: { user: { read: "ftw" } }
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
17
|
+
expect(res.prefs.user.read).to eq "ftw"
|
18
|
+
expect(res.prefs).to be_a(Resource)
|
19
|
+
expect(res.prefs.user).to be_a(Resource)
|
20
|
+
end
|
18
21
|
|
19
|
-
|
20
|
-
|
22
|
+
it "has nested collections" do
|
23
|
+
res = Resource.new labels: [{ color: "blue" }]
|
21
24
|
|
22
|
-
|
23
|
-
|
25
|
+
expect(res.labels.size).to eq 1
|
26
|
+
|
27
|
+
label = res.labels.first
|
28
|
+
expect(label.color).to eq "blue"
|
29
|
+
expect(label).to be_a(Resource)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "handles clashing keys" do
|
33
|
+
res = Resource.new client: 1, fields: 2
|
34
|
+
|
35
|
+
expect(res.fields).to eq 2
|
36
|
+
|
37
|
+
expect(res._fields).to include(:fields)
|
38
|
+
expect(res._fields.size).to eq(2)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "has attribute predicates" do
|
42
|
+
res = Resource.new a: 1, b: true, c: nil, d: false
|
43
|
+
|
44
|
+
expect(res.a?).to be_truthy
|
45
|
+
expect(res.b?).to be_truthy
|
46
|
+
expect(res.c?).to be_falsey
|
47
|
+
expect(res.d?).to be_falsey
|
48
|
+
end
|
49
|
+
|
50
|
+
it "has attribute setters" do
|
51
|
+
res = Resource.new a: 1
|
52
|
+
|
53
|
+
expect(res.a).to eq 1
|
54
|
+
expect(res.key?(:a)).to be_truthy
|
55
|
+
|
56
|
+
res.b = 2
|
57
|
+
expect(res.b).to eq 2
|
58
|
+
expect(res.key?(:b)).to be_truthy
|
59
|
+
end
|
60
|
+
|
61
|
+
it "dynamically adds attr methods through getters" do
|
62
|
+
res = Resource.new
|
63
|
+
|
64
|
+
expect(res.respond_to?(:a)).to be_falsey
|
65
|
+
expect(res.respond_to?(:a=)).to be_falsey
|
66
|
+
expect(res.respond_to?(:a?)).to be_falsey
|
67
|
+
|
68
|
+
res = Resource.new a: 1
|
69
|
+
expect(res.respond_to?(:a)).to be_truthy
|
70
|
+
expect(res.respond_to?(:a=)).to be_truthy
|
71
|
+
expect(res.respond_to?(:a?)).to be_truthy
|
72
|
+
end
|
73
|
+
|
74
|
+
it "has nillable attribute getters" do
|
75
|
+
res = Resource.new a: 1
|
76
|
+
|
77
|
+
expect(res.key?(:b)).to be_falsey
|
78
|
+
expect(res.respond_to?(:b)).to be_falsey
|
79
|
+
expect(res.respond_to?(:b=)).to be_falsey
|
80
|
+
expect(res.respond_to?(:b?)).to be_falsey
|
81
|
+
expect(res.b).to be_nil
|
82
|
+
expect { res.b }.not_to raise_error
|
83
|
+
end
|
24
84
|
|
85
|
+
it "dynamically adds attr methods through setters" do
|
86
|
+
res = Resource.new a: 1
|
87
|
+
|
88
|
+
expect(res.key?(:b)).to be_falsey
|
89
|
+
expect(res.respond_to?(:b)).to be_falsey
|
90
|
+
expect(res.respond_to?(:b=)).to be_falsey
|
91
|
+
expect(res.respond_to?(:b?)).to be_falsey
|
92
|
+
|
93
|
+
res.b = 1
|
94
|
+
|
95
|
+
expect(res.key?(:b)).to be_truthy
|
96
|
+
expect(res.respond_to?(:b)).to be_truthy
|
97
|
+
expect(res.respond_to?(:b=)).to be_truthy
|
98
|
+
expect(res.respond_to?(:b?)).to be_truthy
|
99
|
+
end
|
100
|
+
|
101
|
+
it "is enumerable" do
|
102
|
+
res = Resource.new a: 1, b: 2
|
103
|
+
|
104
|
+
output = []
|
105
|
+
res.each { |k, v| output << [k, v] }
|
106
|
+
expect(output).to eq [[:a, 1], [:b, 2]]
|
107
|
+
end
|
108
|
+
|
109
|
+
it "casts date timestamps" do
|
110
|
+
res = Resource.new date: "2015-01-13T13:43:00.347Z"
|
111
|
+
|
112
|
+
expect(res.date).to be_a(DateTime)
|
113
|
+
end
|
114
|
+
|
115
|
+
describe "#attrs" do
|
116
|
+
it "returns hash of attributes" do
|
117
|
+
res = Resource.new a: 1
|
118
|
+
|
119
|
+
expect(res.to_attrs).to eq a: 1
|
120
|
+
end
|
121
|
+
|
122
|
+
it "returns nested attributes" do
|
123
|
+
res = Resource.new a: 1, b: [{ c: 2 }]
|
124
|
+
|
125
|
+
expect(res.b).to be_a(Array)
|
126
|
+
expect(res.b.first).to be_a(Resource)
|
127
|
+
|
128
|
+
expect(res.to_attrs).to eq(a: 1, b: [{ c: 2 }])
|
129
|
+
end
|
130
|
+
|
131
|
+
it "responds to [] and []=" do
|
132
|
+
res = Resource.new a: 1
|
133
|
+
|
134
|
+
expect(res.a).to eq 1
|
135
|
+
expect(res[:a]).to eq 1
|
136
|
+
expect(res["a"]).to eq 1
|
137
|
+
|
138
|
+
res[:a] = 2
|
139
|
+
expect(res.a).to eq 2
|
140
|
+
expect(res[:a]).to eq 2
|
141
|
+
expect(res["a"]).to eq 2
|
142
|
+
|
143
|
+
res["a"] = 3
|
144
|
+
expect(res.a).to eq 3
|
145
|
+
expect(res[:a]).to eq 3
|
146
|
+
expect(res["a"]).to eq 3
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
25
150
|
end
|
26
151
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Tacokit
|
4
4
|
describe Transform do
|
@@ -15,13 +15,13 @@ module Tacokit
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "does not change empty body" do
|
18
|
-
result = process(
|
19
|
-
expect(result).to eq
|
18
|
+
result = process("")
|
19
|
+
expect(result).to eq ""
|
20
20
|
end
|
21
21
|
|
22
22
|
it "does not change string body" do
|
23
|
-
result = process(
|
24
|
-
expect(result).to eq
|
23
|
+
result = process("{a: 1}")
|
24
|
+
expect(result).to eq "{a: 1}"
|
25
25
|
end
|
26
26
|
|
27
27
|
it "does not change empty hash body" do
|
@@ -31,47 +31,50 @@ module Tacokit
|
|
31
31
|
|
32
32
|
context "hash body" do
|
33
33
|
it "it stringifies keys" do
|
34
|
-
result = process(hello:
|
34
|
+
result = process(hello: "world")
|
35
35
|
|
36
|
-
expect(result).to eq
|
36
|
+
expect(result).to eq "hello" => "world"
|
37
37
|
end
|
38
38
|
|
39
39
|
it "lower camelizes keys" do
|
40
|
-
result = process(hello_world:
|
40
|
+
result = process(hello_world: "hello_world", biggie_smalls: "biggie_smalls")
|
41
41
|
|
42
|
-
expect(result).to include(
|
43
|
-
expect(result).to include(
|
42
|
+
expect(result).to include("helloWorld" => "hello_world")
|
43
|
+
expect(result).to include("biggieSmalls" => "biggie_smalls")
|
44
44
|
end
|
45
45
|
|
46
46
|
it "flattens nested keys" do
|
47
|
-
result = process(prefs: {
|
47
|
+
result = process(prefs: { "showSidebar" => true })
|
48
48
|
|
49
|
-
expect(result).to eq(
|
49
|
+
expect(result).to eq("prefs/showSidebar" => true)
|
50
50
|
end
|
51
51
|
|
52
52
|
it "coverts id suffix to prefix" do
|
53
|
-
result = process(
|
53
|
+
result = process("card_id" => "a" * 10)
|
54
54
|
|
55
|
-
expect(result).to eq(
|
55
|
+
expect(result).to eq("idCard" => "a" * 10)
|
56
56
|
end
|
57
57
|
|
58
58
|
it "coverts ids suffix to prefix and pluralizes" do
|
59
|
-
result = process(
|
59
|
+
result = process("card_ids" => "a" * 10)
|
60
60
|
|
61
|
-
expect(result).to eq(
|
61
|
+
expect(result).to eq("idCards" => "a" * 10)
|
62
62
|
end
|
63
63
|
|
64
64
|
describe "special cases" do
|
65
|
-
|
66
65
|
it "callbackURL" do
|
67
|
-
result = process(callback_url:
|
66
|
+
result = process(callback_url: "http://example.com")
|
68
67
|
|
69
|
-
expect(result).to eq(
|
68
|
+
expect(result).to eq("callbackURL" => "http://example.com")
|
70
69
|
end
|
71
|
-
end
|
72
70
|
|
73
|
-
|
71
|
+
it "idChecklistSource" do
|
72
|
+
result = process("checklist_source_id" => "a" * 10)
|
74
73
|
|
74
|
+
expect(result).to eq("idChecklistSource" => "a" * 10)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
75
78
|
end
|
76
79
|
|
77
80
|
describe "#deserialize" do
|
@@ -85,13 +88,13 @@ module Tacokit
|
|
85
88
|
end
|
86
89
|
|
87
90
|
it "does not change empty body" do
|
88
|
-
result = process(
|
89
|
-
expect(result).to eq
|
91
|
+
result = process("")
|
92
|
+
expect(result).to eq ""
|
90
93
|
end
|
91
94
|
|
92
95
|
it "does not change string body" do
|
93
|
-
result = process(
|
94
|
-
expect(result).to eq
|
96
|
+
result = process("{a: 1}")
|
97
|
+
expect(result).to eq "{a: 1}"
|
95
98
|
end
|
96
99
|
|
97
100
|
it "does not change empty hash body" do
|
@@ -101,31 +104,30 @@ module Tacokit
|
|
101
104
|
|
102
105
|
context "hash body" do
|
103
106
|
it "it stringifies keys" do
|
104
|
-
result = process(hello:
|
107
|
+
result = process(hello: "world")
|
105
108
|
|
106
|
-
expect(result).to eq
|
109
|
+
expect(result).to eq "hello" => "world"
|
107
110
|
end
|
108
111
|
|
109
112
|
it "underscores keys" do
|
110
|
-
result = process(helloWorld:
|
113
|
+
result = process(helloWorld: "helloWorld", biggieSmalls: "biggieSmalls")
|
111
114
|
|
112
|
-
expect(result).to include(
|
113
|
-
expect(result).to include(
|
115
|
+
expect(result).to include("hello_world" => "helloWorld")
|
116
|
+
expect(result).to include("biggie_smalls" => "biggieSmalls")
|
114
117
|
end
|
115
118
|
|
116
119
|
it "coverts id prefix to suffix" do
|
117
|
-
result = process(
|
120
|
+
result = process("idCard" => "a" * 10, "idBoardPinned" => "123")
|
118
121
|
|
119
|
-
expect(result).to eq(
|
122
|
+
expect(result).to eq("card_id" => "a" * 10, "board_pinned_id" => "123")
|
120
123
|
end
|
121
124
|
|
122
125
|
it "coverts ids suffix to prefix and pluralizes" do
|
123
|
-
result = process(
|
126
|
+
result = process("idCards" => "a" * 10, "idBoardsPinned" => ["123"])
|
124
127
|
|
125
|
-
expect(result).to eq(
|
128
|
+
expect(result).to eq("card_ids" => "a" * 10, "boards_pinned_ids" => ["123"])
|
126
129
|
end
|
127
130
|
end
|
128
|
-
|
129
131
|
end
|
130
132
|
end
|
131
133
|
end
|
data/spec/tacokit_spec.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Tacokit do
|
4
|
-
|
5
4
|
describe "#method_missing" do
|
6
5
|
it "forwards messages to client" do
|
7
|
-
expect(Tacokit.client).to receive(:
|
8
|
-
Tacokit.
|
6
|
+
expect(Tacokit.client).to receive(:get_app_key)
|
7
|
+
Tacokit.get_app_key
|
9
8
|
end
|
10
9
|
|
11
10
|
it "raises otherwise" do
|
12
11
|
expect { Tacokit.no_method }.to raise_error(NoMethodError)
|
13
12
|
end
|
14
|
-
|
15
13
|
end
|
16
14
|
end
|
data/tacokit.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "tacokit/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "tacokit"
|
8
8
|
spec.version = Tacokit::VERSION
|
9
9
|
spec.authors = ["Ross Kaffenberger"]
|
10
10
|
spec.email = ["rosskaff@gmail.com"]
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
11
|
+
spec.summary = "A ruby toolkit for the Trello API."
|
12
|
+
spec.description = "A ruby toolkit for the Trello API."
|
13
13
|
spec.homepage = "http://rossta.github.io/tacokit.rb"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency "simple_oauth"
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.7"
|
26
|
-
spec.add_development_dependency "rake", "~> 10
|
27
|
-
spec.add_development_dependency "rspec", "~> 3
|
26
|
+
spec.add_development_dependency "rake", "~> 10"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3"
|
28
28
|
end
|