troo 0.0.4 → 0.0.5
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/lib/troo/actions/create_board.rb +1 -1
- data/lib/troo/actions/create_card.rb +1 -1
- data/lib/troo/actions/create_comment.rb +1 -1
- data/lib/troo/actions/create_list.rb +1 -1
- data/lib/troo/cli/add_cli.rb +10 -10
- data/lib/troo/cli/cli_helpers.rb +34 -0
- data/lib/troo/cli/default_cli.rb +8 -22
- data/lib/troo/cli/main_cli.rb +52 -50
- data/lib/troo/cli/show_cli.rb +32 -51
- data/lib/troo/display/board_decorator.rb +4 -0
- data/lib/troo/display/board_presenter.rb +44 -38
- data/lib/troo/display/card_decorator.rb +8 -13
- data/lib/troo/display/card_presenter.rb +4 -4
- data/lib/troo/display/comment_decorator.rb +2 -1
- data/lib/troo/display/comment_presenter.rb +8 -12
- data/lib/troo/display/decorator_helpers.rb +8 -0
- data/lib/troo/display/list_decorator.rb +4 -0
- data/lib/troo/display/list_presenter.rb +18 -20
- data/lib/troo/display/member_decorator.rb +3 -2
- data/lib/troo/display/member_presenter.rb +4 -4
- data/lib/troo/external/board.rb +2 -2
- data/lib/troo/external/card.rb +1 -1
- data/lib/troo/external/comment.rb +1 -1
- data/lib/troo/external/list.rb +1 -1
- data/lib/troo/external/member.rb +1 -1
- data/lib/troo/models/board.rb +12 -0
- data/lib/troo/models/card.rb +14 -2
- data/lib/troo/models/comment.rb +7 -3
- data/lib/troo/models/list.rb +13 -1
- data/lib/troo/models/member.rb +8 -0
- data/lib/troo/troo.rb +1 -1
- data/lib/troo/version.rb +1 -1
- data/test/lib/troo/actions/create_board_test.rb +1 -1
- data/test/lib/troo/actions/create_card_test.rb +1 -1
- data/test/lib/troo/actions/create_comment_test.rb +1 -1
- data/test/lib/troo/actions/create_list_test.rb +1 -1
- data/test/lib/troo/cli/add_cli_test.rb +18 -18
- data/test/lib/troo/cli/{thor_fixes_test.rb → cli_helpers_test.rb} +3 -0
- data/test/lib/troo/cli/default_cli_test.rb +6 -6
- data/test/lib/troo/cli/main_cli_test.rb +22 -20
- data/test/lib/troo/cli/show_cli_test.rb +57 -27
- data/test/lib/troo/display/board_decorator_test.rb +2 -2
- data/test/lib/troo/display/board_presenter_test.rb +2 -2
- data/test/lib/troo/display/card_decorator_test.rb +6 -14
- data/test/lib/troo/display/card_presenter_test.rb +2 -2
- data/test/lib/troo/display/comment_decorator_test.rb +6 -1
- data/test/lib/troo/display/comment_presenter_test.rb +2 -2
- data/test/lib/troo/display/decorator_helpers_test.rb +21 -1
- data/test/lib/troo/display/list_presenter_test.rb +2 -2
- data/test/lib/troo/display/member_decorator_test.rb +6 -1
- data/test/lib/troo/display/member_presenter_test.rb +2 -2
- metadata +6 -6
- data/lib/troo/cli/thor_fixes.rb +0 -9
@@ -11,53 +11,55 @@ module Troo
|
|
11
11
|
after { database_cleanup }
|
12
12
|
|
13
13
|
describe "#status" do
|
14
|
+
let(:default) { false }
|
15
|
+
|
14
16
|
before do
|
15
|
-
@board = Fabricate(:board, default:
|
16
|
-
@list = Fabricate(:list, default:
|
17
|
-
@card = Fabricate(:card, default:
|
17
|
+
@board = Fabricate(:board, default: default)
|
18
|
+
@list = Fabricate(:list, default: default)
|
19
|
+
@card = Fabricate(:card, default: default)
|
18
20
|
end
|
19
21
|
|
20
22
|
subject { capture_io { described_instance.status }.join }
|
21
23
|
|
22
24
|
context "when a default board is set" do
|
25
|
+
let(:default) { true }
|
26
|
+
|
23
27
|
it "returns a polite message" do
|
24
28
|
subject.must_match /My Test Board/
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
28
32
|
context "when a default board is not set" do
|
29
|
-
before { Troo::BoardRetrieval.stubs(:default).returns(nil) }
|
30
|
-
|
31
33
|
it "returns a polite message" do
|
32
|
-
subject.must_match /
|
34
|
+
subject.must_match /No default board set/
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
36
38
|
context "when a default list is set" do
|
39
|
+
let(:default) { true }
|
40
|
+
|
37
41
|
it "returns a polite message" do
|
38
42
|
subject.must_match /My Test List/
|
39
43
|
end
|
40
44
|
end
|
41
45
|
|
42
46
|
context "when a default list is not set" do
|
43
|
-
before { Troo::ListRetrieval.stubs(:default).returns(nil) }
|
44
|
-
|
45
47
|
it "returns a polite message" do
|
46
|
-
subject.must_match /
|
48
|
+
subject.must_match /No default list set/
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
50
52
|
context "when a default card is set" do
|
53
|
+
let(:default) { true }
|
54
|
+
|
51
55
|
it "returns a polite message" do
|
52
56
|
subject.must_match /My Test Card/
|
53
57
|
end
|
54
58
|
end
|
55
59
|
|
56
60
|
context "when a default card is not set" do
|
57
|
-
before { Troo::CardRetrieval.stubs(:default).returns(nil) }
|
58
|
-
|
59
61
|
it "returns a polite message" do
|
60
|
-
subject.must_match /
|
62
|
+
subject.must_match /No default card set/
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
@@ -65,7 +67,7 @@ module Troo
|
|
65
67
|
before { Troo::Board.stubs(:count).returns(0) }
|
66
68
|
|
67
69
|
it "returns a polite message" do
|
68
|
-
subject.must_match /No
|
70
|
+
subject.must_match /No boards found/
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
@@ -73,7 +75,7 @@ module Troo
|
|
73
75
|
before { Troo::List.stubs(:count).returns(0) }
|
74
76
|
|
75
77
|
it "returns a polite message" do
|
76
|
-
subject.must_match /No
|
78
|
+
subject.must_match /No lists found/
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
@@ -81,7 +83,7 @@ module Troo
|
|
81
83
|
before { Troo::Card.stubs(:count).returns(0) }
|
82
84
|
|
83
85
|
it "returns a polite message" do
|
84
|
-
subject.must_match /No
|
86
|
+
subject.must_match /No cards found/
|
85
87
|
end
|
86
88
|
end
|
87
89
|
end
|
@@ -94,7 +96,7 @@ module Troo
|
|
94
96
|
before do
|
95
97
|
RefreshAll.stubs(:all)
|
96
98
|
RefreshAll.stubs(:default)
|
97
|
-
|
99
|
+
BoardRetrieval.stubs(:default).returns(default)
|
98
100
|
RefreshAll.stubs(:lists)
|
99
101
|
RefreshAll.stubs(:cards)
|
100
102
|
end
|
@@ -187,8 +189,8 @@ module Troo
|
|
187
189
|
@card = Fabricate(:card)
|
188
190
|
@list = Fabricate(:list)
|
189
191
|
Troo::MoveCard.stubs(:with).returns(true)
|
190
|
-
|
191
|
-
|
192
|
+
CardRetrieval.stubs(:retrieve).returns(@card)
|
193
|
+
ListRetrieval.stubs(:retrieve).returns(@list)
|
192
194
|
end
|
193
195
|
|
194
196
|
subject { capture_io { described_class.new.move(card_id, list_id) }.join }
|
@@ -211,7 +213,7 @@ module Troo
|
|
211
213
|
end
|
212
214
|
|
213
215
|
context "when the list was not found" do
|
214
|
-
before {
|
216
|
+
before { ListRetrieval.stubs(:retrieve) }
|
215
217
|
|
216
218
|
it "returns a polite message" do
|
217
219
|
subject.must_match /list was not found/
|
@@ -220,7 +222,7 @@ module Troo
|
|
220
222
|
end
|
221
223
|
|
222
224
|
context "when the card was not found" do
|
223
|
-
before {
|
225
|
+
before { CardRetrieval.stubs(:retrieve) }
|
224
226
|
|
225
227
|
it "returns a polite message" do
|
226
228
|
subject.must_match /card was not found/
|
@@ -31,7 +31,7 @@ module Troo
|
|
31
31
|
end
|
32
32
|
|
33
33
|
context "when no boards exist" do
|
34
|
-
before {
|
34
|
+
before { BoardRetrieval.stubs(:all).returns([]) }
|
35
35
|
|
36
36
|
it "returns a polite message" do
|
37
37
|
subject.must_match /Boards not found./
|
@@ -49,13 +49,21 @@ module Troo
|
|
49
49
|
subject.must_match /Test List/
|
50
50
|
subject.must_match /Test Card/
|
51
51
|
end
|
52
|
+
|
53
|
+
context "but there are no lists" do
|
54
|
+
before { @list.delete }
|
55
|
+
|
56
|
+
it "returns a polite message" do
|
57
|
+
subject.must_match /No lists were found/
|
58
|
+
end
|
59
|
+
end
|
52
60
|
end
|
53
61
|
|
54
62
|
context "and the board does not exist" do
|
55
|
-
before {
|
63
|
+
before { BoardRetrieval.stubs(:retrieve) }
|
56
64
|
|
57
65
|
it "returns a polite message" do
|
58
|
-
subject.must_match /Board
|
66
|
+
subject.must_match /Board cannot be found./
|
59
67
|
end
|
60
68
|
end
|
61
69
|
end
|
@@ -64,7 +72,7 @@ module Troo
|
|
64
72
|
let(:board_id) { }
|
65
73
|
|
66
74
|
context "and the default board is set" do
|
67
|
-
before {
|
75
|
+
before { BoardRetrieval.stubs(:retrieve).returns(@board) }
|
68
76
|
|
69
77
|
it "returns the board with all lists and all cards" do
|
70
78
|
subject.must_match /Test Board/
|
@@ -74,7 +82,7 @@ module Troo
|
|
74
82
|
end
|
75
83
|
|
76
84
|
context "and the default board is not set" do
|
77
|
-
before {
|
85
|
+
before { BoardRetrieval.stubs(:retrieve) }
|
78
86
|
|
79
87
|
it "returns a polite message" do
|
80
88
|
subject.must_match /set a default board first/
|
@@ -87,19 +95,27 @@ module Troo
|
|
87
95
|
subject { capture_io { described_class.new.list(list_id) }.join }
|
88
96
|
|
89
97
|
context "when a list_id was provided" do
|
90
|
-
context "
|
98
|
+
context "and the list exists" do
|
91
99
|
it "returns the list's board, the list and all cards" do
|
92
100
|
subject.must_match /Test Board/
|
93
101
|
subject.must_match /Test List/
|
94
102
|
subject.must_match /Test Card/
|
95
103
|
end
|
104
|
+
|
105
|
+
context "but there are no cards" do
|
106
|
+
before { @card.delete }
|
107
|
+
|
108
|
+
it "returns a polite message" do
|
109
|
+
subject.must_match /No cards were found/
|
110
|
+
end
|
111
|
+
end
|
96
112
|
end
|
97
113
|
|
98
|
-
context "
|
99
|
-
before {
|
114
|
+
context "and the list does not exist" do
|
115
|
+
before { ListRetrieval.stubs(:retrieve) }
|
100
116
|
|
101
117
|
it "returns a polite message" do
|
102
|
-
subject.must_match /List
|
118
|
+
subject.must_match /List cannot be found/
|
103
119
|
end
|
104
120
|
end
|
105
121
|
end
|
@@ -108,7 +124,7 @@ module Troo
|
|
108
124
|
let(:list_id) { }
|
109
125
|
|
110
126
|
context "and the default list is set" do
|
111
|
-
before {
|
127
|
+
before { ListRetrieval.stubs(:retrieve).returns(@list) }
|
112
128
|
|
113
129
|
it "returns the list's board, the list and all cards" do
|
114
130
|
subject.must_match /Test Board/
|
@@ -118,7 +134,7 @@ module Troo
|
|
118
134
|
end
|
119
135
|
|
120
136
|
context "and the default list is not set" do
|
121
|
-
before {
|
137
|
+
before { ListRetrieval.stubs(:retrieve) }
|
122
138
|
|
123
139
|
it "returns a polite message" do
|
124
140
|
subject.must_match /set a default list first/
|
@@ -131,22 +147,28 @@ module Troo
|
|
131
147
|
subject { capture_io { described_class.new.card(card_id) }.join }
|
132
148
|
|
133
149
|
context "when a card_id was provided" do
|
134
|
-
context "
|
135
|
-
before { @comment.delete }
|
136
|
-
|
150
|
+
context "and the card exists" do
|
137
151
|
it "returns the card details" do
|
138
152
|
subject.must_match /\(67\) My Test Card/
|
139
153
|
subject.must_match /some description/
|
140
154
|
subject.must_match /Metadata/
|
141
155
|
subject.must_match /Tue, Dec 17 at 21:48/
|
142
156
|
end
|
157
|
+
|
158
|
+
context "but there are no comments" do
|
159
|
+
before { @comment.delete }
|
160
|
+
|
161
|
+
it "returns a polite message" do
|
162
|
+
subject.must_match /No comments have been left/
|
163
|
+
end
|
164
|
+
end
|
143
165
|
end
|
144
166
|
|
145
|
-
context "
|
146
|
-
before {
|
167
|
+
context "and the card does not exist" do
|
168
|
+
before { CardRetrieval.stubs(:retrieve) }
|
147
169
|
|
148
170
|
it "returns a polite message" do
|
149
|
-
subject.must_match /Card
|
171
|
+
subject.must_match /Card cannot be found/
|
150
172
|
end
|
151
173
|
end
|
152
174
|
end
|
@@ -155,7 +177,7 @@ module Troo
|
|
155
177
|
let(:card_id) { }
|
156
178
|
|
157
179
|
context "and the default card is set" do
|
158
|
-
before {
|
180
|
+
before { CardRetrieval.stubs(:retrieve).returns(@card) }
|
159
181
|
|
160
182
|
it "returns the card details" do
|
161
183
|
subject.must_match /\(67\) My Test Card/
|
@@ -166,7 +188,7 @@ module Troo
|
|
166
188
|
end
|
167
189
|
|
168
190
|
context "and the default card is not set" do
|
169
|
-
before {
|
191
|
+
before { CardRetrieval.stubs(:retrieve) }
|
170
192
|
|
171
193
|
it "returns a polite message" do
|
172
194
|
subject.must_match /set a default card first/
|
@@ -179,18 +201,26 @@ module Troo
|
|
179
201
|
subject { capture_io { described_class.new.comments(card_id) }.join }
|
180
202
|
|
181
203
|
context "when a card_id was provided" do
|
182
|
-
context "
|
204
|
+
context "and the card exists" do
|
183
205
|
it "returns the card and all comments" do
|
184
|
-
subject.must_match
|
206
|
+
subject.must_match /My Test Card/
|
185
207
|
subject.must_match /My Test Comment/
|
186
208
|
end
|
209
|
+
|
210
|
+
context "but there are no comments" do
|
211
|
+
before { @comment.delete }
|
212
|
+
|
213
|
+
it "returns a polite message" do
|
214
|
+
subject.must_match /No comments were found/
|
215
|
+
end
|
216
|
+
end
|
187
217
|
end
|
188
218
|
|
189
|
-
context "
|
190
|
-
before {
|
219
|
+
context "and the card does not exist" do
|
220
|
+
before { CardRetrieval.stubs(:retrieve) }
|
191
221
|
|
192
222
|
it "returns a polite message" do
|
193
|
-
subject.must_match /Card
|
223
|
+
subject.must_match /Card cannot be found/
|
194
224
|
end
|
195
225
|
end
|
196
226
|
end
|
@@ -199,16 +229,16 @@ module Troo
|
|
199
229
|
let(:card_id) { }
|
200
230
|
|
201
231
|
context "and the default card is set" do
|
202
|
-
before {
|
232
|
+
before { CardRetrieval.stubs(:retrieve).returns(@card) }
|
203
233
|
|
204
234
|
it "returns the card and all comments" do
|
205
|
-
subject.must_match
|
235
|
+
subject.must_match /My Test Card/
|
206
236
|
subject.must_match /My Test Comment/
|
207
237
|
end
|
208
238
|
end
|
209
239
|
|
210
240
|
context "and the default card is not set" do
|
211
|
-
before {
|
241
|
+
before { CardRetrieval.stubs(:retrieve) }
|
212
242
|
|
213
243
|
it "returns a polite message" do
|
214
244
|
subject.must_match /set a default card first/
|
@@ -71,7 +71,7 @@ module Troo
|
|
71
71
|
end
|
72
72
|
|
73
73
|
context "when the board has no description" do
|
74
|
-
before { @board.stubs(:description)
|
74
|
+
before { @board.stubs(:description) }
|
75
75
|
|
76
76
|
it "returns N/A" do
|
77
77
|
subject.must_equal("N/A")
|
@@ -89,7 +89,7 @@ module Troo
|
|
89
89
|
end
|
90
90
|
|
91
91
|
context "when the board has no name" do
|
92
|
-
before { @board.stubs(:name)
|
92
|
+
before { @board.stubs(:name) }
|
93
93
|
|
94
94
|
it "returns N/A" do
|
95
95
|
subject.must_equal("N/A")
|
@@ -44,8 +44,8 @@ module Troo
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
describe "#
|
48
|
-
subject { capture_io { described_class.
|
47
|
+
describe "#show" do
|
48
|
+
subject { capture_io { described_class.show(@board, options) }.join }
|
49
49
|
|
50
50
|
context "when the board has lists" do
|
51
51
|
context "and the list has cards" do
|
@@ -38,31 +38,23 @@ module Troo
|
|
38
38
|
subject { described_instance.short }
|
39
39
|
|
40
40
|
it "returns a one line overview of the card" do
|
41
|
-
subject.must_equal(" *
|
41
|
+
subject.must_equal(" * \e[35m\e[4m(67) \e[0m\e[35m\e[4mMy Test Card\e[0m\n")
|
42
42
|
end
|
43
43
|
|
44
44
|
context "when the ansicolor option is false" do
|
45
45
|
let(:options) { { ansicolor: false } }
|
46
46
|
|
47
|
-
it "returns a one line overview of the
|
47
|
+
it "returns a one line overview of the card" do
|
48
48
|
subject.must_equal(" * (67) My Test Card\n")
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
describe "#title" do
|
54
|
-
subject { described_instance.title }
|
55
|
-
|
56
|
-
it "returns a formatted string representing the card title" do
|
57
|
-
subject.must_match /\* \(67\) My Test Card/
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
53
|
describe "#name_str" do
|
62
54
|
subject { described_instance.name_str }
|
63
55
|
|
64
56
|
it "returns the formatted card name" do
|
65
|
-
subject.must_equal("
|
57
|
+
subject.must_equal("\e[35m\e[4mMy Test Card\e[0m")
|
66
58
|
end
|
67
59
|
end
|
68
60
|
|
@@ -78,7 +70,7 @@ module Troo
|
|
78
70
|
subject { described_instance.id_str }
|
79
71
|
|
80
72
|
it "returns the formatted card id" do
|
81
|
-
subject.must_equal("
|
73
|
+
subject.must_equal("\e[35m\e[4m(67) \e[0m")
|
82
74
|
end
|
83
75
|
end
|
84
76
|
|
@@ -206,7 +198,7 @@ module Troo
|
|
206
198
|
subject { described_instance.board }
|
207
199
|
|
208
200
|
it "returns the board details" do
|
209
|
-
subject.
|
201
|
+
subject.must_equal " \e[35m\e[4m(1) \e[0m\e[35m\e[4mMy Test Board\e[0m\n"
|
210
202
|
end
|
211
203
|
end
|
212
204
|
|
@@ -214,7 +206,7 @@ module Troo
|
|
214
206
|
subject { described_class.new(@card).list }
|
215
207
|
|
216
208
|
it "returns the list details" do
|
217
|
-
subject.
|
209
|
+
subject.must_equal " \e[35m\e[4m(1) \e[0m\e[35m\e[4mMy Test List\e[0m\n"
|
218
210
|
end
|
219
211
|
end
|
220
212
|
end
|
@@ -25,8 +25,8 @@ module Troo
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe "#
|
29
|
-
subject { capture_io { described_class.
|
28
|
+
describe "#show" do
|
29
|
+
subject { capture_io { described_class.show(@card, options) }.join }
|
30
30
|
|
31
31
|
it "renders the view" do
|
32
32
|
subject.must_match /My Test Card/
|
@@ -4,6 +4,7 @@ module Troo
|
|
4
4
|
describe CommentDecorator do
|
5
5
|
let(:described_class) { CommentDecorator }
|
6
6
|
let(:default) { true }
|
7
|
+
let(:options) { {} }
|
7
8
|
|
8
9
|
before do
|
9
10
|
@comment = Fabricate(:comment)
|
@@ -13,11 +14,15 @@ module Troo
|
|
13
14
|
after { database_cleanup }
|
14
15
|
|
15
16
|
describe "#initialize" do
|
16
|
-
subject { described_class.new(@comment) }
|
17
|
+
subject { described_class.new(@comment, options) }
|
17
18
|
|
18
19
|
it "assigns the comment to an instance variable" do
|
19
20
|
subject.instance_variable_get("@comment").must_equal(@comment)
|
20
21
|
end
|
22
|
+
|
23
|
+
it "assigns the options to an instance variable" do
|
24
|
+
subject.instance_variable_get("@options").must_equal(options)
|
25
|
+
end
|
21
26
|
end
|
22
27
|
|
23
28
|
describe "#as_view" do
|
@@ -25,8 +25,8 @@ module Troo
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe "#
|
29
|
-
subject { capture_io { described_class.
|
28
|
+
describe "#show" do
|
29
|
+
subject { capture_io { described_class.show(@card, options) }.join }
|
30
30
|
|
31
31
|
context "when the card has comments" do
|
32
32
|
it "renders the view" do
|
@@ -1,7 +1,27 @@
|
|
1
1
|
require_relative "../../../test_helper"
|
2
2
|
|
3
|
+
class DecoratorHelpersDummy
|
4
|
+
include Troo::DecoratorHelpers
|
5
|
+
end
|
6
|
+
|
3
7
|
module Troo
|
4
8
|
describe DecoratorHelpers do
|
5
|
-
let(:described_class) {
|
9
|
+
let(:described_class) { DecoratorHelpersDummy }
|
10
|
+
let(:described_instance) { described_class.new }
|
11
|
+
|
12
|
+
describe "#title" do
|
13
|
+
before do
|
14
|
+
described_instance.stubs(:default).returns("*")
|
15
|
+
described_instance.stubs(:id).returns(67)
|
16
|
+
described_instance.stubs(:name).returns("My Test Dummy")
|
17
|
+
described_instance.stubs(:options).returns({})
|
18
|
+
end
|
19
|
+
|
20
|
+
subject { described_instance.title }
|
21
|
+
|
22
|
+
it "returns a formatted string representing the card title" do
|
23
|
+
subject.must_match /\* \(67\) My Test Dummy/
|
24
|
+
end
|
25
|
+
end
|
6
26
|
end
|
7
27
|
end
|
@@ -25,8 +25,8 @@ module Troo
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe "#
|
29
|
-
subject { capture_io { described_class.
|
28
|
+
describe "#show" do
|
29
|
+
subject { capture_io { described_class.show(@list, options) }.join }
|
30
30
|
|
31
31
|
context "when the list has cards" do
|
32
32
|
it "renders the view" do
|
@@ -3,16 +3,21 @@ require_relative "../../../test_helper"
|
|
3
3
|
module Troo
|
4
4
|
describe MemberDecorator do
|
5
5
|
let(:described_class) { MemberDecorator }
|
6
|
+
let(:options) { {} }
|
6
7
|
|
7
8
|
before { @member = Fabricate(:member) }
|
8
9
|
after { database_cleanup }
|
9
10
|
|
10
11
|
describe "#initialize" do
|
11
|
-
subject { described_class.new(@member) }
|
12
|
+
subject { described_class.new(@member, options) }
|
12
13
|
|
13
14
|
it "assigns the member to an instance variable" do
|
14
15
|
subject.instance_variable_get("@member").must_equal(@member)
|
15
16
|
end
|
17
|
+
|
18
|
+
it "assigns the options to an instance variable" do
|
19
|
+
subject.instance_variable_get("@options").must_equal(options)
|
20
|
+
end
|
16
21
|
end
|
17
22
|
|
18
23
|
describe "#username" do
|
@@ -25,8 +25,8 @@ module Troo
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe "#
|
29
|
-
subject { described_class.
|
28
|
+
describe "#show" do
|
29
|
+
subject { described_class.show(@card, options) }
|
30
30
|
|
31
31
|
context "when there is one member" do
|
32
32
|
it "returns the member" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: troo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Laking
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
@@ -320,10 +320,10 @@ files:
|
|
320
320
|
- lib/troo/actions/refresh_all.rb
|
321
321
|
- lib/troo/actions/set_default.rb
|
322
322
|
- lib/troo/cli/add_cli.rb
|
323
|
+
- lib/troo/cli/cli_helpers.rb
|
323
324
|
- lib/troo/cli/default_cli.rb
|
324
325
|
- lib/troo/cli/main_cli.rb
|
325
326
|
- lib/troo/cli/show_cli.rb
|
326
|
-
- lib/troo/cli/thor_fixes.rb
|
327
327
|
- lib/troo/display/board_decorator.rb
|
328
328
|
- lib/troo/display/board_presenter.rb
|
329
329
|
- lib/troo/display/card_decorator.rb
|
@@ -395,10 +395,10 @@ files:
|
|
395
395
|
- test/lib/troo/actions/refresh_all_test.rb
|
396
396
|
- test/lib/troo/actions/set_default_test.rb
|
397
397
|
- test/lib/troo/cli/add_cli_test.rb
|
398
|
+
- test/lib/troo/cli/cli_helpers_test.rb
|
398
399
|
- test/lib/troo/cli/default_cli_test.rb
|
399
400
|
- test/lib/troo/cli/main_cli_test.rb
|
400
401
|
- test/lib/troo/cli/show_cli_test.rb
|
401
|
-
- test/lib/troo/cli/thor_fixes_test.rb
|
402
402
|
- test/lib/troo/display/board_decorator_test.rb
|
403
403
|
- test/lib/troo/display/board_presenter_test.rb
|
404
404
|
- test/lib/troo/display/card_decorator_test.rb
|
@@ -465,7 +465,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
465
465
|
version: '0'
|
466
466
|
requirements: []
|
467
467
|
rubyforge_project:
|
468
|
-
rubygems_version: 2.2.
|
468
|
+
rubygems_version: 2.2.1
|
469
469
|
signing_key:
|
470
470
|
specification_version: 4
|
471
471
|
summary: CLI interface for Trello.
|
@@ -513,10 +513,10 @@ test_files:
|
|
513
513
|
- test/lib/troo/actions/refresh_all_test.rb
|
514
514
|
- test/lib/troo/actions/set_default_test.rb
|
515
515
|
- test/lib/troo/cli/add_cli_test.rb
|
516
|
+
- test/lib/troo/cli/cli_helpers_test.rb
|
516
517
|
- test/lib/troo/cli/default_cli_test.rb
|
517
518
|
- test/lib/troo/cli/main_cli_test.rb
|
518
519
|
- test/lib/troo/cli/show_cli_test.rb
|
519
|
-
- test/lib/troo/cli/thor_fixes_test.rb
|
520
520
|
- test/lib/troo/display/board_decorator_test.rb
|
521
521
|
- test/lib/troo/display/board_presenter_test.rb
|
522
522
|
- test/lib/troo/display/card_decorator_test.rb
|