troo 0.0.8 → 0.0.9

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.
Files changed (316) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.ruby-version +1 -1
  4. data/.trooconf.example +18 -0
  5. data/Gemfile.lock +178 -0
  6. data/README.md +77 -21
  7. data/Rakefile +1 -1
  8. data/bin/completion.bash +10 -0
  9. data/bin/completion.zsh +10 -0
  10. data/bin/init.sh +15 -0
  11. data/bin/troo +12 -3
  12. data/config/cucumber.yml +3 -3
  13. data/config/en.yml +29 -0
  14. data/config/trello_api.yml +19 -0
  15. data/features/add/board.feature +3 -19
  16. data/features/add/card.feature +14 -18
  17. data/features/add/comment.feature +14 -14
  18. data/features/add/list.feature +11 -14
  19. data/features/default/board.feature +4 -4
  20. data/features/default/card.feature +4 -4
  21. data/features/default/list.feature +4 -4
  22. data/features/move/card.feature +54 -0
  23. data/features/refresh/all.feature +8 -4
  24. data/features/refresh/board.feature +9 -6
  25. data/features/refresh/card.feature +9 -6
  26. data/features/refresh/list.feature +9 -6
  27. data/features/show/board.feature +7 -7
  28. data/features/show/boards.feature +19 -0
  29. data/features/show/card.feature +86 -15
  30. data/features/show/comment.feature +14 -12
  31. data/features/show/list.feature +19 -14
  32. data/features/status.feature +27 -13
  33. data/features/step_definitions/fabrication_steps.rb +43 -8
  34. data/features/step_definitions/troo_steps.rb +3 -2
  35. data/features/support/env.rb +1 -0
  36. data/features/troo.feature +0 -12
  37. data/lib/troo.rb +32 -29
  38. data/lib/troo/api/client.rb +117 -0
  39. data/lib/troo/api/endpoints.rb +39 -0
  40. data/lib/troo/api/headers.rb +44 -0
  41. data/lib/troo/api/oauth_settings.rb +36 -0
  42. data/lib/troo/api/request.rb +37 -0
  43. data/lib/troo/api/response.rb +31 -0
  44. data/lib/troo/cli/add.rb +8 -12
  45. data/lib/troo/cli/commands/add.rb +95 -0
  46. data/lib/troo/cli/commands/default.rb +44 -0
  47. data/lib/troo/cli/commands/move/card.rb +95 -0
  48. data/lib/troo/cli/commands/refresh.rb +80 -0
  49. data/lib/troo/cli/commands/refresh/all.rb +52 -0
  50. data/lib/troo/cli/commands/show.rb +56 -0
  51. data/lib/troo/cli/commands/show/show_boards.rb +36 -0
  52. data/lib/troo/cli/commands/show/show_comments.rb +54 -0
  53. data/lib/troo/cli/commands/status.rb +68 -0
  54. data/lib/troo/cli/default.rb +3 -3
  55. data/lib/troo/cli/main.rb +60 -9
  56. data/lib/troo/cli/refresh.rb +4 -4
  57. data/lib/troo/cli/show.rb +7 -7
  58. data/lib/troo/cli/thor_fixes.rb +1 -5
  59. data/lib/troo/configuration.rb +53 -0
  60. data/lib/troo/debug.rb +18 -0
  61. data/lib/troo/decorators/member.rb +2 -19
  62. data/lib/troo/decorators/resource.rb +130 -0
  63. data/lib/troo/helpers/decorator_helpers.rb +21 -74
  64. data/lib/troo/helpers/model_helpers.rb +19 -4
  65. data/lib/troo/helpers/remote_model_helpers.rb +54 -0
  66. data/lib/troo/models/board.rb +19 -11
  67. data/lib/troo/models/card.rb +20 -17
  68. data/lib/troo/models/comment.rb +28 -8
  69. data/lib/troo/models/list.rb +22 -14
  70. data/lib/troo/models/member.rb +21 -5
  71. data/lib/troo/models/refresh.rb +3 -4
  72. data/lib/troo/persistence/local.rb +63 -0
  73. data/lib/troo/presentation/formatter.rb +132 -0
  74. data/lib/troo/presentation/template.rb +0 -4
  75. data/lib/troo/presenters/board.rb +32 -51
  76. data/lib/troo/presenters/card.rb +4 -11
  77. data/lib/troo/presenters/comment.rb +30 -16
  78. data/lib/troo/presenters/list.rb +25 -21
  79. data/lib/troo/presenters/member.rb +1 -8
  80. data/lib/troo/remote/all.rb +16 -0
  81. data/lib/troo/remote/board.rb +64 -0
  82. data/lib/troo/remote/card.rb +81 -0
  83. data/lib/troo/remote/comment.rb +70 -0
  84. data/lib/troo/remote/comment_data.rb +11 -0
  85. data/lib/troo/remote/comment_data_board.rb +13 -0
  86. data/lib/troo/remote/comment_data_card.rb +15 -0
  87. data/lib/troo/remote/list.rb +49 -0
  88. data/lib/troo/remote/member.rb +75 -0
  89. data/lib/troo/remote/persistence/board.rb +57 -0
  90. data/lib/troo/remote/persistence/card.rb +59 -0
  91. data/lib/troo/remote/persistence/comment.rb +58 -0
  92. data/lib/troo/remote/persistence/list.rb +57 -0
  93. data/lib/troo/remote/persistence/move_card.rb +85 -0
  94. data/lib/troo/retrieval/local.rb +100 -0
  95. data/lib/troo/retrieval/remote.rb +91 -0
  96. data/lib/troo/troo.rb +42 -42
  97. data/lib/troo/version.rb +1 -1
  98. data/lib/troo/views/card.erb +8 -10
  99. data/lib/troo/views/comments.erb +4 -0
  100. data/test/cassettes/board_by_id.yml +21 -30
  101. data/test/cassettes/boards_all.yml +22 -90
  102. data/test/cassettes/card_by_id.yml +49 -0
  103. data/test/cassettes/cards_by_board_id.yml +22 -90
  104. data/test/cassettes/cards_by_list_id.yml +22 -87
  105. data/test/cassettes/comments_by_board_id.yml +22 -95
  106. data/test/cassettes/comments_by_card_id.yml +22 -87
  107. data/test/cassettes/create_board.yml +20 -32
  108. data/test/cassettes/create_card.yml +21 -35
  109. data/test/cassettes/create_comment.yml +19 -37
  110. data/test/cassettes/create_list.yml +18 -32
  111. data/test/cassettes/list_by_id.yml +46 -0
  112. data/test/cassettes/lists_by_board_id.yml +19 -91
  113. data/test/cassettes/member_by_id.yml +48 -0
  114. data/test/cassettes/members_by_board_id.yml +21 -82
  115. data/test/cassettes/move_card_board.yml +49 -0
  116. data/test/cassettes/move_card_list.yml +49 -0
  117. data/test/lib/troo/api/client_test.rb +75 -0
  118. data/test/lib/troo/api/endpoints_test.rb +48 -0
  119. data/test/lib/troo/api/headers_test.rb +27 -0
  120. data/test/lib/troo/api/oauth_settings_test.rb +10 -0
  121. data/test/lib/troo/api/request_test.rb +63 -0
  122. data/test/lib/troo/api/response_test.rb +15 -0
  123. data/test/lib/troo/cli/add_test.rb +113 -0
  124. data/test/lib/troo/cli/commands/add_test.rb +66 -0
  125. data/test/lib/troo/cli/commands/default_test.rb +39 -0
  126. data/test/lib/troo/cli/commands/move/card_test.rb +86 -0
  127. data/test/lib/troo/cli/commands/refresh/all_test.rb +37 -0
  128. data/test/lib/troo/cli/commands/refresh_test.rb +59 -0
  129. data/test/lib/troo/cli/commands/show/show_boards_test.rb +35 -0
  130. data/test/lib/troo/cli/commands/show/show_comments_test.rb +63 -0
  131. data/test/lib/troo/cli/commands/show_test.rb +65 -0
  132. data/test/lib/troo/cli/commands/status_test.rb +48 -0
  133. data/test/lib/troo/cli/default_test.rb +39 -0
  134. data/test/lib/troo/cli/main_test.rb +102 -0
  135. data/test/lib/troo/cli/refresh_test.rb +43 -0
  136. data/test/lib/troo/cli/show_test.rb +49 -0
  137. data/test/lib/troo/cli/thor_fixes_test.rb +38 -0
  138. data/test/lib/troo/configuration_test.rb +43 -0
  139. data/test/lib/troo/debug_test.rb +25 -0
  140. data/test/lib/troo/decorators/card_test.rb +105 -229
  141. data/test/lib/troo/decorators/member_test.rb +20 -35
  142. data/test/lib/troo/decorators/resource_test.rb +157 -0
  143. data/test/lib/troo/helpers/decorator_helpers_test.rb +10 -19
  144. data/test/lib/troo/helpers/model_helpers_test.rb +18 -8
  145. data/test/lib/troo/helpers/remote_model_helpers_test.rb +68 -0
  146. data/test/lib/troo/models/behaviours/set_default_test.rb +0 -10
  147. data/test/lib/troo/models/board_test.rb +2 -2
  148. data/test/lib/troo/models/card_test.rb +2 -2
  149. data/test/lib/troo/models/comment_test.rb +6 -2
  150. data/test/lib/troo/models/list_test.rb +2 -2
  151. data/test/lib/troo/models/member_test.rb +6 -2
  152. data/test/lib/troo/persistence/local_test.rb +31 -0
  153. data/test/lib/troo/presentation/formatter_test.rb +31 -0
  154. data/test/lib/troo/presentation/sentence_test.rb +0 -12
  155. data/test/lib/troo/presentation/template_test.rb +1 -14
  156. data/test/lib/troo/presenters/board_test.rb +17 -36
  157. data/test/lib/troo/presenters/card_test.rb +1 -31
  158. data/test/lib/troo/presenters/comment_test.rb +19 -19
  159. data/test/lib/troo/presenters/list_test.rb +18 -18
  160. data/test/lib/troo/presenters/member_test.rb +1 -14
  161. data/test/lib/troo/remote/board_test.rb +66 -0
  162. data/test/lib/troo/remote/card_test.rb +81 -0
  163. data/test/lib/troo/remote/comment_data_board.rb +9 -0
  164. data/test/lib/troo/remote/comment_data_card_test.rb +9 -0
  165. data/test/lib/troo/remote/comment_data_test.rb +9 -0
  166. data/test/lib/troo/remote/comment_test.rb +100 -0
  167. data/test/lib/troo/remote/list_test.rb +67 -0
  168. data/test/lib/troo/remote/member_test.rb +70 -0
  169. data/test/lib/troo/remote/persistence/board_test.rb +39 -0
  170. data/test/lib/troo/remote/persistence/card_test.rb +50 -0
  171. data/test/lib/troo/remote/persistence/comment_test.rb +45 -0
  172. data/test/lib/troo/remote/persistence/list_test.rb +45 -0
  173. data/test/lib/troo/remote/persistence/move_card_test.rb +78 -0
  174. data/test/lib/troo/retrieval/local_test.rb +192 -0
  175. data/test/lib/troo/retrieval/remote_test.rb +49 -0
  176. data/test/support/fabrication.rb +17 -17
  177. data/test/support/fake_trello/fake_response.rb +38 -0
  178. data/test/support/fake_trello/server.rb +124 -0
  179. data/test/support/remotes/all_boards.json +41 -0
  180. data/test/support/remotes/board.json +140 -0
  181. data/test/support/remotes/board_by_id.json +75 -0
  182. data/test/support/remotes/card.json +40 -0
  183. data/test/support/remotes/card_by_card_id.json +302 -0
  184. data/test/support/remotes/comment.json +27 -0
  185. data/test/support/remotes/create_board.json +38 -0
  186. data/test/support/remotes/list.json +7 -0
  187. data/test/support/remotes/member.json +50 -0
  188. data/test/system_test.sh +21 -1
  189. data/test/test_helper.rb +2 -1
  190. data/troo.gemspec +28 -20
  191. metadata +376 -269
  192. data/configuration.yml.example +0 -7
  193. data/features/cleanup.feature +0 -13
  194. data/lib/troo/actions/create_board.rb +0 -46
  195. data/lib/troo/actions/create_card.rb +0 -44
  196. data/lib/troo/actions/create_comment.rb +0 -46
  197. data/lib/troo/actions/create_list.rb +0 -42
  198. data/lib/troo/actions/move_card.rb +0 -37
  199. data/lib/troo/adaptors/board.rb +0 -32
  200. data/lib/troo/adaptors/card.rb +0 -67
  201. data/lib/troo/adaptors/comment.rb +0 -42
  202. data/lib/troo/adaptors/list.rb +0 -37
  203. data/lib/troo/adaptors/member.rb +0 -52
  204. data/lib/troo/adaptors/resource.rb +0 -17
  205. data/lib/troo/commands/add/board.rb +0 -26
  206. data/lib/troo/commands/add/card.rb +0 -33
  207. data/lib/troo/commands/add/comment.rb +0 -33
  208. data/lib/troo/commands/add/list.rb +0 -33
  209. data/lib/troo/commands/add/resource.rb +0 -21
  210. data/lib/troo/commands/commands.rb +0 -28
  211. data/lib/troo/commands/default/board.rb +0 -25
  212. data/lib/troo/commands/default/card.rb +0 -25
  213. data/lib/troo/commands/default/list.rb +0 -25
  214. data/lib/troo/commands/default/resource.rb +0 -26
  215. data/lib/troo/commands/refresh/all.rb +0 -41
  216. data/lib/troo/commands/refresh/board.rb +0 -28
  217. data/lib/troo/commands/refresh/card.rb +0 -29
  218. data/lib/troo/commands/refresh/list.rb +0 -29
  219. data/lib/troo/commands/refresh/resource.rb +0 -42
  220. data/lib/troo/commands/show/board.rb +0 -13
  221. data/lib/troo/commands/show/boards.rb +0 -35
  222. data/lib/troo/commands/show/card.rb +0 -13
  223. data/lib/troo/commands/show/comments.rb +0 -21
  224. data/lib/troo/commands/show/list.rb +0 -13
  225. data/lib/troo/commands/show/resource.rb +0 -41
  226. data/lib/troo/commands/status/board.rb +0 -30
  227. data/lib/troo/commands/status/card.rb +0 -30
  228. data/lib/troo/commands/status/list.rb +0 -30
  229. data/lib/troo/commands/status/resource.rb +0 -34
  230. data/lib/troo/decorators/board.rb +0 -66
  231. data/lib/troo/decorators/card.rb +0 -105
  232. data/lib/troo/decorators/comment.rb +0 -36
  233. data/lib/troo/decorators/list.rb +0 -60
  234. data/lib/troo/external/board.rb +0 -31
  235. data/lib/troo/external/card.rb +0 -31
  236. data/lib/troo/external/comment.rb +0 -27
  237. data/lib/troo/external/list.rb +0 -27
  238. data/lib/troo/external/member.rb +0 -27
  239. data/lib/troo/external/resource.rb +0 -42
  240. data/lib/troo/helpers/command_helpers.rb +0 -37
  241. data/lib/troo/models/persistence/board.rb +0 -19
  242. data/lib/troo/models/persistence/card.rb +0 -19
  243. data/lib/troo/models/persistence/comment.rb +0 -19
  244. data/lib/troo/models/persistence/list.rb +0 -19
  245. data/lib/troo/models/persistence/member.rb +0 -19
  246. data/lib/troo/models/persistence/resource.rb +0 -50
  247. data/lib/troo/models/remote/comment.rb +0 -21
  248. data/lib/troo/models/remote/resource.rb +0 -25
  249. data/lib/troo/models/retrieval/board.rb +0 -29
  250. data/lib/troo/models/retrieval/card.rb +0 -33
  251. data/lib/troo/models/retrieval/comment.rb +0 -25
  252. data/lib/troo/models/retrieval/list.rb +0 -29
  253. data/lib/troo/models/retrieval/member.rb +0 -25
  254. data/lib/troo/models/retrieval/resource.rb +0 -36
  255. data/lib/troo/views/comment.erb +0 -3
  256. data/test/cassettes/card_by_card_id.yml +0 -58
  257. data/test/cassettes/comments_by_list_id.yml +0 -109
  258. data/test/cassettes/list_by_list_id.yml +0 -56
  259. data/test/cassettes/member_by_member_id.yml +0 -60
  260. data/test/cassettes/move_card.yml +0 -61
  261. data/test/lib/troo/actions/create_board_test.rb +0 -66
  262. data/test/lib/troo/actions/create_card_test.rb +0 -71
  263. data/test/lib/troo/actions/create_comment_test.rb +0 -71
  264. data/test/lib/troo/actions/create_list_test.rb +0 -65
  265. data/test/lib/troo/actions/move_card_test.rb +0 -54
  266. data/test/lib/troo/adaptors/board_test.rb +0 -38
  267. data/test/lib/troo/adaptors/card_test.rb +0 -49
  268. data/test/lib/troo/adaptors/comment_test.rb +0 -41
  269. data/test/lib/troo/adaptors/list_test.rb +0 -38
  270. data/test/lib/troo/adaptors/member_test.rb +0 -44
  271. data/test/lib/troo/commands/add/board_test.rb +0 -43
  272. data/test/lib/troo/commands/add/card_test.rb +0 -44
  273. data/test/lib/troo/commands/add/comment_test.rb +0 -44
  274. data/test/lib/troo/commands/add/list_test.rb +0 -44
  275. data/test/lib/troo/commands/add/resource_test.rb +0 -25
  276. data/test/lib/troo/commands/default/board_test.rb +0 -37
  277. data/test/lib/troo/commands/default/card_test.rb +0 -37
  278. data/test/lib/troo/commands/default/list_test.rb +0 -37
  279. data/test/lib/troo/commands/default/resource_test.rb +0 -20
  280. data/test/lib/troo/commands/refresh/all_test.rb +0 -39
  281. data/test/lib/troo/commands/refresh/board_test.rb +0 -62
  282. data/test/lib/troo/commands/refresh/card_test.rb +0 -62
  283. data/test/lib/troo/commands/refresh/list_test.rb +0 -62
  284. data/test/lib/troo/commands/refresh/resource_test.rb +0 -20
  285. data/test/lib/troo/commands/show/board_test.rb +0 -65
  286. data/test/lib/troo/commands/show/boards_test.rb +0 -36
  287. data/test/lib/troo/commands/show/card_test.rb +0 -64
  288. data/test/lib/troo/commands/show/comments_test.rb +0 -64
  289. data/test/lib/troo/commands/show/list_test.rb +0 -64
  290. data/test/lib/troo/commands/show/resource_test.rb +0 -25
  291. data/test/lib/troo/commands/status/board_test.rb +0 -43
  292. data/test/lib/troo/commands/status/card_test.rb +0 -43
  293. data/test/lib/troo/commands/status/list_test.rb +0 -43
  294. data/test/lib/troo/commands/status/resource_test.rb +0 -19
  295. data/test/lib/troo/decorators/board_test.rb +0 -129
  296. data/test/lib/troo/decorators/comment_test.rb +0 -74
  297. data/test/lib/troo/decorators/list_test.rb +0 -102
  298. data/test/lib/troo/external/board_test.rb +0 -102
  299. data/test/lib/troo/external/card_test.rb +0 -131
  300. data/test/lib/troo/external/comment_test.rb +0 -109
  301. data/test/lib/troo/external/list_test.rb +0 -94
  302. data/test/lib/troo/external/member_test.rb +0 -94
  303. data/test/lib/troo/external/resource_test.rb +0 -25
  304. data/test/lib/troo/helpers/command_helpers_test.rb +0 -82
  305. data/test/lib/troo/models/persistence/board_test.rb +0 -62
  306. data/test/lib/troo/models/persistence/card_test.rb +0 -61
  307. data/test/lib/troo/models/persistence/comment_test.rb +0 -69
  308. data/test/lib/troo/models/persistence/list_test.rb +0 -60
  309. data/test/lib/troo/models/persistence/member_test.rb +0 -60
  310. data/test/lib/troo/models/remote/comment_test.rb +0 -56
  311. data/test/lib/troo/models/remote/resource_test.rb +0 -26
  312. data/test/lib/troo/models/retrieval/board_test.rb +0 -93
  313. data/test/lib/troo/models/retrieval/card_test.rb +0 -101
  314. data/test/lib/troo/models/retrieval/comment_test.rb +0 -46
  315. data/test/lib/troo/models/retrieval/list_test.rb +0 -93
  316. data/test/lib/troo/models/retrieval/member_test.rb +0 -58
@@ -0,0 +1,19 @@
1
+ version_1:
2
+ boards_all: '/members/me/boards'
3
+ board_by_id: '/boards/%{external_id}'
4
+ card_by_id: '/cards/%{external_id}'
5
+ list_by_id: '/lists/%{external_id}'
6
+ member_by_id: '/members/%{external_id}'
7
+ cards_by_board_id: '/boards/%{external_id}/cards'
8
+ cards_by_list_id: '/lists/%{external_id}/cards'
9
+ comments_by_board_id: '/boards/%{external_id}/actions'
10
+ comments_by_card_id: '/cards/%{external_id}/actions'
11
+ comments_by_list_id: '/lists/%{external_id}/actions'
12
+ lists_by_board_id: '/boards/%{external_id}/lists'
13
+ members_by_board_id: '/boards/%{external_id}/members'
14
+ create_board: '/boards'
15
+ create_card: '/cards'
16
+ create_comment: '/cards/%{external_id}/actions/comments'
17
+ create_list: '/lists'
18
+ move_card_list: '/cards/%{external_id}/idList'
19
+ move_card_board: '/cards/%{external_id}/idBoard'
@@ -2,25 +2,9 @@ Feature: Adding content to Trello
2
2
 
3
3
  @add
4
4
  Scenario: Add a board
5
- Given the Trello API is stubbed with "add_board_success"
6
- When I run `troo add board "Cuke Add Board"`
5
+ Given the Trello API is stubbed with "200_create_board"
6
+ When I run `troo add board "My Cucumber Board"`
7
7
  Then the output should contain:
8
8
  """
9
- New board 'Cuke Add Board' created.
9
+ New board 'My Cucumber Board' created.
10
10
  """
11
-
12
- @pending @failing @add
13
- Scenario: Add a board, name not provided
14
- Given the Trello API is stubbed with "add_board_interactive_success"
15
- When I run `troo add board` interactively
16
- And I type "Cuke Add Board Interactive"
17
- Then the output should contain:
18
- """
19
- New board 'Cuke Add Board Interactive' created.
20
- """
21
-
22
- @pending @failing @add
23
- Scenario: Cannot add a board
24
- Given the Trello API is stubbed with "add_board_failure"
25
- When I run `troo add board "My New Board"`
26
- Then the output should contain "Board could not be created."
@@ -2,33 +2,29 @@ Feature: Adding content to Trello
2
2
  Background:
3
3
  Given a list exists
4
4
 
5
- @pending @failing @add
5
+ @add
6
6
  Scenario: Add a card
7
- Given the Trello API is stubbed with "add_card_success"
8
- When I run `troo add card 1 "My Cucumber Card"`
7
+ Given the Trello API is stubbed with "200_create_card"
8
+ When I run `troo add card 200 "My Cucumber Card"`
9
9
  Then the output should contain:
10
10
  """
11
- New card 'My Cucumber Card' created
11
+ New card 'My Cucumber Card' created.
12
12
  """
13
13
 
14
14
  @add
15
15
  Scenario: Add a card, name not provided
16
- Given the Trello API is stubbed with "add_card_failure"
17
- When I run `troo add card 1 ""`
18
- Then the output should contain "Card could not be created"
19
-
20
- @pending @failing @add
21
- Scenario: Add a card, name not provided
22
- Given the Trello API is stubbed with "add_card_interactive_success"
23
- When I run `troo --test add card 1`
24
- And I type "My New Exciting Card"
16
+ Given the Trello API is stubbed with "400_create_card"
17
+ When I run `troo add card 400 ""`
25
18
  Then the output should contain:
26
19
  """
27
- New card 'My New Exciting Card' created
20
+ Card could not be created.
28
21
  """
29
22
 
30
- @pending @failing @add
23
+ @add
31
24
  Scenario: Cannot add a card as list not found
32
- Given the Trello API is stubbed with "add_card_list_not_found"
33
- When I run `troo add card 1 "My Cucumber Card"`
34
- Then the output should contain ""
25
+ Given the Trello API is stubbed with "400_create_card"
26
+ When I run `troo add card 400 "My Cucumber Card"`
27
+ Then the output should contain:
28
+ """
29
+ Card could not be created.
30
+ """
@@ -2,20 +2,20 @@ Feature: Adding content to Trello
2
2
  Background:
3
3
  Given a card exists
4
4
 
5
- @pending @failing @add
5
+ @add
6
6
  Scenario: Add a comment
7
- Given the Trello API is stubbed with "add_comment_success"
8
- When I run `troo add comment 69 ""`
9
- Then the output should contain ""
7
+ Given the Trello API is stubbed with "200_create_comment"
8
+ When I run `troo add comment 200 "My Cucumber Comment"`
9
+ Then the output should contain:
10
+ """
11
+ New comment created.
12
+ """
10
13
 
11
- @pending @failing @add
12
- Scenario: Add a comment, comment not provided
13
- Given the Trello API is stubbed with "add_comment_interactive_success"
14
- When I run `troo add comment` interactively
15
- And I type "My New Exciting Comment"
16
- Then the output should contain ""
17
-
18
- @pending @failing @add
14
+ @add
19
15
  Scenario: Cannot add a comment as card not found
20
- When I run `troo add comment 69 ""`
21
- Then the output should contain ""
16
+ Given the Trello API is stubbed with "400_create_comment"
17
+ When I run `troo add comment 400 "My Cucumber Comment"`
18
+ Then the output should contain:
19
+ """
20
+ Comment could not be created.
21
+ """
@@ -2,23 +2,20 @@ Feature: Adding content to Trello
2
2
  Background:
3
3
  Given a board exists
4
4
 
5
- @pending @failing @add
5
+ @add
6
6
  Scenario: Add a list
7
- Given the Trello API is stubbed with "add_list_success"
8
- When I run `troo add list 1 "My Cucumber List"`
7
+ Given the Trello API is stubbed with "200_create_list"
8
+ When I run `troo add list 200 "My Cucumber List"`
9
9
  Then the output should contain:
10
10
  """
11
- New list 'My Cucumber Card' created
11
+ New list 'My Cucumber List' created.
12
12
  """
13
13
 
14
- @pending @failing @add
15
- Scenario: Add a list, name not provided
16
- Given the Trello API is stubbed with "add_list_interactive_success"
17
- When I run `troo add list` interactively
18
- And I type "My New Exciting List"
19
- Then the output should contain ""
20
-
21
- @pending @failing @add
14
+ @add
22
15
  Scenario: Cannot add a list as board not found
23
- When I run `troo add list 69 ""`
24
- Then the output should contain ""
16
+ Given the Trello API is stubbed with "400_create_list"
17
+ When I run `troo add list 400 "My Cucumber List"`
18
+ Then the output should contain:
19
+ """
20
+ List could not be created.
21
+ """
@@ -3,16 +3,16 @@ Feature: Setting a default board
3
3
  @default
4
4
  Scenario: Set a board to default
5
5
  Given a board exists
6
- When I run `troo default board 1`
6
+ When I run `troo default board 200`
7
7
  Then the output should contain:
8
8
  """
9
- 'My Test Board' set as default board.
9
+ 'My Test Board' set as default.
10
10
  """
11
11
 
12
12
  @default
13
13
  Scenario: Cannot set a default; not found
14
- Given the Trello API is stubbed with "fetch_board_by_id"
15
- When I run `troo default board 69`
14
+ Given the Trello API is stubbed with "400_board_by_id"
15
+ When I run `troo default board 400`
16
16
  Then the output should contain "Board cannot be found."
17
17
 
18
18
  @default
@@ -3,16 +3,16 @@ Feature: Setting a default card
3
3
  @default
4
4
  Scenario: Set a card to default
5
5
  Given a card exists
6
- When I run `troo default card 1`
6
+ When I run `troo default card 200`
7
7
  Then the output should contain:
8
8
  """
9
- 'My Test Card' set as default card.
9
+ 'My Test Card' set as default.
10
10
  """
11
11
 
12
12
  @default
13
13
  Scenario: Cannot set a default; not found
14
- Given the Trello API is stubbed with "fetch_card_by_id"
15
- When I run `troo default card 69`
14
+ Given the Trello API is stubbed with "400_card_by_id"
15
+ When I run `troo default card 400`
16
16
  Then the output should contain "Card cannot be found."
17
17
 
18
18
  @default
@@ -3,16 +3,16 @@ Feature: Setting a default list
3
3
  @default
4
4
  Scenario: Set a list to default
5
5
  Given a list exists
6
- When I run `troo default list 1`
6
+ When I run `troo default list 200`
7
7
  Then the output should contain:
8
8
  """
9
- 'My Test List' set as default list.
9
+ 'My Test List' set as default.
10
10
  """
11
11
 
12
12
  @default
13
13
  Scenario: Cannot set a default; not found
14
- Given the Trello API is stubbed with "fetch_list_by_id"
15
- When I run `troo default list 69`
14
+ Given the Trello API is stubbed with "400_list_by_id"
15
+ When I run `troo default list 400`
16
16
  Then the output should contain "List cannot be found."
17
17
 
18
18
  @default
@@ -0,0 +1,54 @@
1
+ Feature: Moving a card
2
+
3
+ @move
4
+ Scenario: Move a card to another list
5
+ Given the Trello API is stubbed with "200_move_card_200_list"
6
+ And a card exists
7
+ And a list exists
8
+ When I run `troo move 200 200`
9
+ Then the output should contain:
10
+ """
11
+ Card 'My Test Card' moved to 'My Test List'.
12
+ """
13
+
14
+ @move
15
+ Scenario: Cannot move card, card not found
16
+ Given the Trello API is stubbed with "400_move_card_200_list"
17
+ When I run `troo move 400 200`
18
+ Then the output should contain:
19
+ """
20
+ Card cannot be found.
21
+ """
22
+
23
+ @move
24
+ Scenario: Cannot move card, list not found
25
+ Given the Trello API is stubbed with "200_move_card_400_list"
26
+ And a card exists
27
+ When I run `troo move 200 400`
28
+ Then the output should contain:
29
+ """
30
+ List cannot be found.
31
+ """
32
+
33
+ @move
34
+ Scenario: Move a card to another list (different board)
35
+ Given the Trello API is stubbed with "200_move_card_200_board"
36
+ And a card exists
37
+ And a list exists
38
+ And a board exists
39
+ When I run `troo move 200 200 200`
40
+ Then the output should contain:
41
+ """
42
+ Card 'My Test Card' moved to 'My Test List' on 'My Test Board'.
43
+ """
44
+
45
+ @move
46
+ Scenario: Cannot move card, board not found
47
+ Given the Trello API is stubbed with "400_move_card_400_board"
48
+ And a card exists
49
+ And a list exists
50
+ When I run `troo move 200 200 400`
51
+ Then the output should contain:
52
+ """
53
+ Board cannot be found.
54
+ """
@@ -1,7 +1,11 @@
1
1
  Feature: Refreshing all data
2
2
 
3
- @pending @failing @refresh
4
- Scenario: Refresh the local data
5
- Given the Trello API is stubbed with "refresh_all_success"
3
+ @refresh
4
+ Scenario: Refreshing the local data
5
+ Given the Trello API is stubbed with "boards_all"
6
6
  When I run `troo refresh all`
7
- Then the output should contain "All local data refreshed."
7
+ Then the output should contain:
8
+ """
9
+ All local data refreshed.
10
+ """
11
+
@@ -2,20 +2,20 @@ Feature: Refreshing a resource
2
2
 
3
3
  @refresh
4
4
  Scenario: Refresh the board with ID
5
- Given the Trello API is stubbed with "refresh_board_success"
5
+ Given the Trello API is stubbed with "200_board_by_id"
6
6
  And a board exists
7
- When I run `troo refresh board 1`
7
+ When I run `troo refresh board 200`
8
8
  Then the output should contain "refreshed"
9
9
 
10
10
  @refresh
11
11
  Scenario: Cannot refresh; board not found
12
- Given the Trello API is stubbed with "refresh_board_not_found"
13
- When I run `troo refresh board 69`
12
+ Given the Trello API is stubbed with "400_board_by_id"
13
+ When I run `troo refresh board 400`
14
14
  Then the output should contain "Board cannot be found"
15
15
 
16
16
  @refresh
17
17
  Scenario: Refresh the default board
18
- Given the Trello API is stubbed with "refresh_default_board_success"
18
+ Given the Trello API is stubbed with "200_board_by_id"
19
19
  And a default board exists
20
20
  When I run `troo refresh board`
21
21
  Then the output should contain "refreshed"
@@ -23,4 +23,7 @@ Feature: Refreshing a resource
23
23
  @refresh
24
24
  Scenario: Cannot refresh; no default board
25
25
  When I run `troo refresh board`
26
- Then the output should contain "Default board cannot be found"
26
+ Then the output should contain:
27
+ """
28
+ Board cannot be found. Specify an <id> or use 'troo default board <id>' to set a default board first.
29
+ """
@@ -2,20 +2,20 @@ Feature: Refreshing a card
2
2
 
3
3
  @refresh
4
4
  Scenario: Refresh the card with ID
5
- Given the Trello API is stubbed with "refresh_card_success"
5
+ Given the Trello API is stubbed with "200_card_by_id"
6
6
  And a card exists
7
- When I run `troo refresh card 1`
7
+ When I run `troo refresh card 200`
8
8
  Then the output should contain "refreshed"
9
9
 
10
10
  @refresh
11
11
  Scenario: Cannot refresh; card not found
12
- Given the Trello API is stubbed with "refresh_card_not_found"
13
- When I run `troo refresh card 69`
12
+ Given the Trello API is stubbed with "400_card_by_id"
13
+ When I run `troo refresh card 400`
14
14
  Then the output should contain "Card cannot be found"
15
15
 
16
16
  @refresh
17
17
  Scenario: Refresh the default card
18
- Given the Trello API is stubbed with "refresh_default_card_success"
18
+ Given the Trello API is stubbed with "200_card_by_id"
19
19
  And a default card exists
20
20
  When I run `troo refresh card`
21
21
  Then the output should contain "refreshed"
@@ -23,5 +23,8 @@ Feature: Refreshing a card
23
23
  @refresh
24
24
  Scenario: Cannot refresh; no default card
25
25
  When I run `troo refresh card`
26
- Then the output should contain "Default card cannot be found"
26
+ Then the output should contain:
27
+ """
28
+ Card cannot be found. Specify an <id> or use 'troo default card <id>' to set a default card first.
29
+ """
27
30
 
@@ -2,20 +2,20 @@ Feature: Refreshing a resource
2
2
 
3
3
  @refresh
4
4
  Scenario: Refresh the list with ID
5
- Given the Trello API is stubbed with "refresh_list_success"
5
+ Given the Trello API is stubbed with "200_list_by_id"
6
6
  And a list exists
7
- When I run `troo refresh list 1`
7
+ When I run `troo refresh list 200`
8
8
  Then the output should contain "refreshed"
9
9
 
10
10
  @refresh
11
11
  Scenario: Cannot refresh; list not found
12
- Given the Trello API is stubbed with "refresh_list_not_found"
13
- When I run `troo refresh list 69`
12
+ Given the Trello API is stubbed with "400_list_by_id"
13
+ When I run `troo refresh list 400`
14
14
  Then the output should contain "List cannot be found"
15
15
 
16
16
  @refresh
17
17
  Scenario: Refresh the default list
18
- Given the Trello API is stubbed with "refresh_default_list_success"
18
+ Given the Trello API is stubbed with "200_list_by_id"
19
19
  And a default list exists
20
20
  When I run `troo refresh list`
21
21
  Then the output should contain "refreshed"
@@ -23,5 +23,8 @@ Feature: Refreshing a resource
23
23
  @refresh
24
24
  Scenario: Cannot refresh; no default list
25
25
  When I run `troo refresh list`
26
- Then the output should contain "Default list cannot be found"
26
+ Then the output should contain:
27
+ """
28
+ List cannot be found. Specify an <id> or use 'troo default list <id>' to set a default list first.
29
+ """
27
30
 
@@ -3,17 +3,17 @@ Feature: Showing a board
3
3
  @show
4
4
  Scenario: Showing a board with ID
5
5
  Given a board exists
6
- When I run `troo show board 1`
6
+ When I run `troo show board 200`
7
7
  Then the output should contain:
8
8
  """
9
- (1) My Test Board
10
- No lists were found.
9
+ (1) My Test Board
10
+ No lists were found.
11
11
  """
12
12
 
13
13
  @show
14
14
  Scenario: Cannot show board; not found
15
- Given the Trello API is stubbed with "fetch_board_by_id"
16
- When I run `troo show board 69`
15
+ Given the Trello API is stubbed with "400_board_by_id"
16
+ When I run `troo show board 400`
17
17
  Then the output should contain "Board cannot be found."
18
18
 
19
19
  @show
@@ -22,8 +22,8 @@ Feature: Showing a board
22
22
  When I run `troo show board`
23
23
  Then the output should contain:
24
24
  """
25
- * (1) My Default Board
26
- No lists were found.
25
+ (1) My Default Board *
26
+ No lists were found.
27
27
  """
28
28
 
29
29
  @show