troo 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (271) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +2 -0
  4. data/Guardfile +3 -1
  5. data/Rakefile +7 -0
  6. data/bin/troo +3 -8
  7. data/config/.gitkeep +0 -0
  8. data/config/cucumber.yml +8 -0
  9. data/features/add/board.feature +26 -0
  10. data/features/add/card.feature +34 -0
  11. data/features/add/comment.feature +21 -0
  12. data/features/add/list.feature +24 -0
  13. data/features/cleanup.feature +13 -0
  14. data/features/default/board.feature +21 -0
  15. data/features/default/card.feature +21 -0
  16. data/features/default/list.feature +21 -0
  17. data/features/refresh/all.feature +7 -0
  18. data/features/refresh/board.feature +26 -0
  19. data/features/refresh/card.feature +27 -0
  20. data/features/refresh/list.feature +27 -0
  21. data/features/show/board.feature +32 -0
  22. data/features/show/card.feature +62 -0
  23. data/features/show/comment.feature +39 -0
  24. data/features/show/list.feature +37 -0
  25. data/features/status.feature +46 -1
  26. data/features/step_definitions/fabrication_steps.rb +34 -0
  27. data/features/step_definitions/troo_steps.rb +16 -0
  28. data/features/support/env.rb +22 -24
  29. data/features/troo.feature +31 -1
  30. data/lib/troo/actions/create_board.rb +10 -7
  31. data/lib/troo/actions/create_card.rb +5 -4
  32. data/lib/troo/actions/create_comment.rb +15 -13
  33. data/lib/troo/actions/create_list.rb +5 -4
  34. data/lib/troo/actions/move_card.rb +4 -3
  35. data/lib/troo/{external/board_adaptor.rb → adaptors/board.rb} +3 -14
  36. data/lib/troo/{external/card_adaptor.rb → adaptors/card.rb} +4 -15
  37. data/lib/troo/{external/comment_adaptor.rb → adaptors/comment.rb} +6 -17
  38. data/lib/troo/{external/list_adaptor.rb → adaptors/list.rb} +3 -14
  39. data/lib/troo/{external/member_adaptor.rb → adaptors/member.rb} +3 -14
  40. data/lib/troo/adaptors/resource.rb +17 -0
  41. data/lib/troo/cli/add.rb +53 -0
  42. data/lib/troo/cli/default.rb +25 -0
  43. data/lib/troo/cli/main.rb +46 -0
  44. data/lib/troo/cli/refresh.rb +31 -0
  45. data/lib/troo/cli/show.rb +41 -0
  46. data/lib/troo/cli/thor_fixes.rb +13 -0
  47. data/lib/troo/commands/add/board.rb +26 -0
  48. data/lib/troo/commands/add/card.rb +33 -0
  49. data/lib/troo/commands/add/comment.rb +33 -0
  50. data/lib/troo/commands/add/list.rb +33 -0
  51. data/lib/troo/commands/add/resource.rb +21 -0
  52. data/lib/troo/commands/commands.rb +28 -0
  53. data/lib/troo/commands/default/board.rb +25 -0
  54. data/lib/troo/commands/default/card.rb +25 -0
  55. data/lib/troo/commands/default/list.rb +25 -0
  56. data/lib/troo/commands/default/resource.rb +26 -0
  57. data/lib/troo/commands/refresh/all.rb +41 -0
  58. data/lib/troo/commands/refresh/board.rb +28 -0
  59. data/lib/troo/commands/refresh/card.rb +29 -0
  60. data/lib/troo/commands/refresh/list.rb +29 -0
  61. data/lib/troo/commands/refresh/resource.rb +42 -0
  62. data/lib/troo/commands/show/board.rb +13 -0
  63. data/lib/troo/commands/show/boards.rb +35 -0
  64. data/lib/troo/commands/show/card.rb +13 -0
  65. data/lib/troo/commands/show/comments.rb +21 -0
  66. data/lib/troo/commands/show/list.rb +13 -0
  67. data/lib/troo/commands/show/resource.rb +41 -0
  68. data/lib/troo/commands/status/board.rb +30 -0
  69. data/lib/troo/commands/status/card.rb +30 -0
  70. data/lib/troo/commands/status/list.rb +30 -0
  71. data/lib/troo/commands/status/resource.rb +34 -0
  72. data/lib/troo/decorators/board.rb +66 -0
  73. data/lib/troo/decorators/card.rb +105 -0
  74. data/lib/troo/decorators/comment.rb +36 -0
  75. data/lib/troo/decorators/list.rb +60 -0
  76. data/lib/troo/decorators/member.rb +28 -0
  77. data/lib/troo/external/board.rb +14 -26
  78. data/lib/troo/external/card.rb +2 -19
  79. data/lib/troo/external/comment.rb +5 -23
  80. data/lib/troo/external/list.rb +2 -20
  81. data/lib/troo/external/member.rb +2 -20
  82. data/lib/troo/external/resource.rb +21 -6
  83. data/lib/troo/helpers/command_helpers.rb +37 -0
  84. data/lib/troo/{display → helpers}/decorator_helpers.rb +23 -17
  85. data/lib/troo/{models → helpers}/model_helpers.rb +1 -1
  86. data/lib/troo/models/behaviours/set_default.rb +49 -0
  87. data/lib/troo/models/board.rb +10 -7
  88. data/lib/troo/models/card.rb +33 -15
  89. data/lib/troo/models/comment.rb +8 -5
  90. data/lib/troo/models/list.rb +10 -6
  91. data/lib/troo/models/member.rb +7 -4
  92. data/lib/troo/models/persistence/board.rb +19 -0
  93. data/lib/troo/models/persistence/card.rb +19 -0
  94. data/lib/troo/models/persistence/comment.rb +19 -0
  95. data/lib/troo/models/persistence/list.rb +19 -0
  96. data/lib/troo/models/persistence/member.rb +19 -0
  97. data/lib/troo/models/persistence/resource.rb +50 -0
  98. data/lib/troo/models/refresh.rb +1 -1
  99. data/lib/troo/models/remote/comment.rb +21 -0
  100. data/lib/troo/models/remote/resource.rb +25 -0
  101. data/lib/troo/models/retrieval/board.rb +29 -0
  102. data/lib/troo/models/retrieval/card.rb +33 -0
  103. data/lib/troo/models/retrieval/comment.rb +25 -0
  104. data/lib/troo/models/retrieval/list.rb +29 -0
  105. data/lib/troo/models/retrieval/member.rb +25 -0
  106. data/lib/troo/models/retrieval/resource.rb +36 -0
  107. data/lib/troo/presentation/sentence.rb +57 -0
  108. data/lib/troo/presentation/template.rb +4 -3
  109. data/lib/troo/presenters/board.rb +81 -0
  110. data/lib/troo/presenters/card.rb +30 -0
  111. data/lib/troo/presenters/comment.rb +38 -0
  112. data/lib/troo/presenters/list.rb +44 -0
  113. data/lib/troo/presenters/member.rb +32 -0
  114. data/lib/troo/troo.rb +79 -65
  115. data/lib/troo/version.rb +1 -2
  116. data/lib/troo.rb +36 -8
  117. data/test/lib/troo/actions/create_board_test.rb +34 -15
  118. data/test/lib/troo/actions/create_card_test.rb +35 -18
  119. data/test/lib/troo/actions/create_comment_test.rb +38 -16
  120. data/test/lib/troo/actions/create_list_test.rb +31 -15
  121. data/test/lib/troo/actions/move_card_test.rb +23 -15
  122. data/test/lib/troo/adaptors/board_test.rb +38 -0
  123. data/test/lib/troo/adaptors/card_test.rb +49 -0
  124. data/test/lib/troo/adaptors/comment_test.rb +41 -0
  125. data/test/lib/troo/adaptors/list_test.rb +38 -0
  126. data/test/lib/troo/adaptors/member_test.rb +44 -0
  127. data/test/lib/troo/commands/add/board_test.rb +43 -0
  128. data/test/lib/troo/commands/add/card_test.rb +44 -0
  129. data/test/lib/troo/commands/add/comment_test.rb +44 -0
  130. data/test/lib/troo/commands/add/list_test.rb +44 -0
  131. data/test/lib/troo/commands/add/resource_test.rb +25 -0
  132. data/test/lib/troo/commands/default/board_test.rb +37 -0
  133. data/test/lib/troo/commands/default/card_test.rb +37 -0
  134. data/test/lib/troo/commands/default/list_test.rb +37 -0
  135. data/test/lib/troo/commands/default/resource_test.rb +20 -0
  136. data/test/lib/troo/commands/refresh/all_test.rb +39 -0
  137. data/test/lib/troo/commands/refresh/board_test.rb +62 -0
  138. data/test/lib/troo/commands/refresh/card_test.rb +62 -0
  139. data/test/lib/troo/commands/refresh/list_test.rb +62 -0
  140. data/test/lib/troo/commands/refresh/resource_test.rb +20 -0
  141. data/test/lib/troo/commands/show/board_test.rb +65 -0
  142. data/test/lib/troo/commands/show/boards_test.rb +36 -0
  143. data/test/lib/troo/commands/show/card_test.rb +64 -0
  144. data/test/lib/troo/commands/show/comments_test.rb +64 -0
  145. data/test/lib/troo/commands/show/list_test.rb +64 -0
  146. data/test/lib/troo/commands/show/resource_test.rb +25 -0
  147. data/test/lib/troo/commands/status/board_test.rb +43 -0
  148. data/test/lib/troo/commands/status/card_test.rb +43 -0
  149. data/test/lib/troo/commands/status/list_test.rb +43 -0
  150. data/test/lib/troo/commands/status/resource_test.rb +19 -0
  151. data/test/lib/troo/decorators/board_test.rb +129 -0
  152. data/test/lib/troo/decorators/card_test.rb +237 -0
  153. data/test/lib/troo/decorators/comment_test.rb +74 -0
  154. data/test/lib/troo/decorators/list_test.rb +102 -0
  155. data/test/lib/troo/decorators/member_test.rb +50 -0
  156. data/test/lib/troo/external/board_test.rb +74 -41
  157. data/test/lib/troo/external/card_test.rb +49 -37
  158. data/test/lib/troo/external/comment_test.rb +43 -33
  159. data/test/lib/troo/external/list_test.rb +37 -30
  160. data/test/lib/troo/external/member_test.rb +37 -30
  161. data/test/lib/troo/external/resource_test.rb +18 -1
  162. data/test/lib/troo/helpers/command_helpers_test.rb +82 -0
  163. data/test/lib/troo/{display → helpers}/decorator_helpers_test.rb +6 -6
  164. data/test/lib/troo/helpers/model_helpers_test.rb +103 -0
  165. data/test/lib/troo/models/behaviours/set_default_test.rb +54 -0
  166. data/test/lib/troo/models/board_test.rb +13 -14
  167. data/test/lib/troo/models/card_test.rb +64 -33
  168. data/test/lib/troo/models/comment_test.rb +18 -19
  169. data/test/lib/troo/models/list_test.rb +15 -15
  170. data/test/lib/troo/models/member_test.rb +18 -18
  171. data/test/lib/troo/models/persistence/board_test.rb +62 -0
  172. data/test/lib/troo/models/persistence/card_test.rb +61 -0
  173. data/test/lib/troo/models/persistence/comment_test.rb +69 -0
  174. data/test/lib/troo/models/persistence/list_test.rb +60 -0
  175. data/test/lib/troo/models/persistence/member_test.rb +60 -0
  176. data/test/lib/troo/models/refresh_test.rb +12 -11
  177. data/test/lib/troo/models/remote/comment_test.rb +56 -0
  178. data/test/lib/troo/models/remote/resource_test.rb +26 -0
  179. data/test/lib/troo/models/retrieval/board_test.rb +93 -0
  180. data/test/lib/troo/models/retrieval/card_test.rb +101 -0
  181. data/test/lib/troo/models/retrieval/comment_test.rb +46 -0
  182. data/test/lib/troo/models/retrieval/list_test.rb +93 -0
  183. data/test/lib/troo/models/retrieval/member_test.rb +58 -0
  184. data/test/lib/troo/presentation/sentence_test.rb +57 -0
  185. data/test/lib/troo/presentation/template_test.rb +17 -16
  186. data/test/lib/troo/presenters/board_test.rb +79 -0
  187. data/test/lib/troo/presenters/card_test.rb +41 -0
  188. data/test/lib/troo/presenters/comment_test.rb +49 -0
  189. data/test/lib/troo/presenters/list_test.rb +50 -0
  190. data/test/lib/troo/presenters/member_test.rb +40 -0
  191. data/test/support/fabrication.rb +31 -32
  192. data/test/support/vcr_setup.rb +7 -9
  193. data/test/system_test.sh +55 -0
  194. data/test/test_helper.rb +10 -10
  195. data/troo.gemspec +1 -0
  196. metadata +232 -134
  197. data/features/add_board.feature +0 -1
  198. data/features/add_card.feature +0 -1
  199. data/features/add_comment.feature +0 -1
  200. data/features/add_list.feature +0 -1
  201. data/features/move_card_to_list.feature +0 -1
  202. data/features/refresh.feature +0 -1
  203. data/features/set_default.feature +0 -7
  204. data/features/show_board.feature +0 -1
  205. data/features/show_boards.feature +0 -1
  206. data/features/show_card.feature +0 -1
  207. data/features/show_comments.feature +0 -1
  208. data/features/show_list.feature +0 -1
  209. data/features/version.feature +0 -8
  210. data/lib/troo/actions/refresh_all.rb +0 -79
  211. data/lib/troo/actions/set_default.rb +0 -46
  212. data/lib/troo/cli/add_cli.rb +0 -83
  213. data/lib/troo/cli/cli_helpers.rb +0 -34
  214. data/lib/troo/cli/default_cli.rb +0 -32
  215. data/lib/troo/cli/main_cli.rb +0 -132
  216. data/lib/troo/cli/show_cli.rb +0 -64
  217. data/lib/troo/display/board_decorator.rb +0 -62
  218. data/lib/troo/display/board_presenter.rb +0 -71
  219. data/lib/troo/display/card_decorator.rb +0 -100
  220. data/lib/troo/display/card_presenter.rb +0 -27
  221. data/lib/troo/display/comment_decorator.rb +0 -33
  222. data/lib/troo/display/comment_presenter.rb +0 -31
  223. data/lib/troo/display/list_decorator.rb +0 -57
  224. data/lib/troo/display/list_presenter.rb +0 -41
  225. data/lib/troo/display/member_decorator.rb +0 -25
  226. data/lib/troo/display/member_presenter.rb +0 -59
  227. data/lib/troo/models/board_persistence.rb +0 -25
  228. data/lib/troo/models/board_retrieval.rb +0 -45
  229. data/lib/troo/models/card_persistence.rb +0 -25
  230. data/lib/troo/models/card_retrieval.rb +0 -49
  231. data/lib/troo/models/comment_persistence.rb +0 -25
  232. data/lib/troo/models/comment_retrieval.rb +0 -32
  233. data/lib/troo/models/list_persistence.rb +0 -25
  234. data/lib/troo/models/list_retrieval.rb +0 -45
  235. data/lib/troo/models/member_persistence.rb +0 -25
  236. data/lib/troo/models/member_retrieval.rb +0 -36
  237. data/lib/troo/models/persistence.rb +0 -39
  238. data/test/lib/troo/actions/refresh_all_test.rb +0 -68
  239. data/test/lib/troo/actions/set_default_test.rb +0 -44
  240. data/test/lib/troo/cli/add_cli_test.rb +0 -216
  241. data/test/lib/troo/cli/cli_helpers_test.rb +0 -24
  242. data/test/lib/troo/cli/default_cli_test.rb +0 -85
  243. data/test/lib/troo/cli/main_cli_test.rb +0 -234
  244. data/test/lib/troo/cli/show_cli_test.rb +0 -251
  245. data/test/lib/troo/display/board_decorator_test.rb +0 -126
  246. data/test/lib/troo/display/board_presenter_test.rb +0 -77
  247. data/test/lib/troo/display/card_decorator_test.rb +0 -213
  248. data/test/lib/troo/display/card_presenter_test.rb +0 -38
  249. data/test/lib/troo/display/comment_decorator_test.rb +0 -70
  250. data/test/lib/troo/display/comment_presenter_test.rb +0 -47
  251. data/test/lib/troo/display/list_decorator_test.rb +0 -98
  252. data/test/lib/troo/display/list_presenter_test.rb +0 -48
  253. data/test/lib/troo/display/member_decorator_test.rb +0 -47
  254. data/test/lib/troo/display/member_presenter_test.rb +0 -70
  255. data/test/lib/troo/external/board_adaptor_test.rb +0 -36
  256. data/test/lib/troo/external/card_adaptor_test.rb +0 -50
  257. data/test/lib/troo/external/comment_adaptor_test.rb +0 -41
  258. data/test/lib/troo/external/list_adaptor_test.rb +0 -38
  259. data/test/lib/troo/external/member_adaptor_test.rb +0 -44
  260. data/test/lib/troo/models/board_persistence_test.rb +0 -61
  261. data/test/lib/troo/models/board_retrieval_test.rb +0 -93
  262. data/test/lib/troo/models/card_persistence_test.rb +0 -60
  263. data/test/lib/troo/models/card_retrieval_test.rb +0 -101
  264. data/test/lib/troo/models/comment_persistence_test.rb +0 -65
  265. data/test/lib/troo/models/comment_retrieval_test.rb +0 -46
  266. data/test/lib/troo/models/list_persistence_test.rb +0 -60
  267. data/test/lib/troo/models/list_retrieval_test.rb +0 -93
  268. data/test/lib/troo/models/member_persistence_test.rb +0 -59
  269. data/test/lib/troo/models/member_retrieval_test.rb +0 -58
  270. data/test/lib/troo/models/model_helpers_test.rb +0 -103
  271. data/test/lib/troo/models/persistence_test.rb +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1892409544a523d004707ad9309cfaa007dd64f2
4
- data.tar.gz: cd9845092a51395014cac272c82384b44851d3b6
3
+ metadata.gz: 7cf7d75305007bbed1c23aa79c3f33230d9ed81a
4
+ data.tar.gz: 46d9a18e57dbba06a2352f6fc39f7dfdd7133159
5
5
  SHA512:
6
- metadata.gz: 51a67ab0c9e90f4e616d7563baba8e1463386174607a8e7f0cace5489ae4b01fbc9b31da2c9789267a8707f376ec19969f764d1c3897ccf1db053f5342652586
7
- data.tar.gz: 483c82aab976ddf5e903bbc320dbf0aa54c6ca7f0426cdac0977c4f1b9e195deb9e08fc1b02872283c0361b0486634c6e9bdaf7106d767293dd248dc22220630
6
+ metadata.gz: 2a9b909ea4d6d641703b2e41ee7be9f9dacd5550e4c38e2f3c17274b7145909c889fe51bc3ccc885051c62fa78df667392a943e64720bc70526a2d7cd337dc39
7
+ data.tar.gz: 5068ac55e7be3ea02fa13eb48a39b3b681d279d546d0a9643b8184df46ac05b72ebfe967b71e5d28c394a89a7ba98edf9fff6af9a2e4a050dc4462d17f78aca4
data/.gitignore CHANGED
@@ -11,11 +11,13 @@ doc/
11
11
  lib/bundler/man
12
12
  pkg
13
13
  rdoc
14
+ rerun.txt
14
15
  spec/reports
15
16
  test/tmp
16
17
  test/version_tmp
17
18
  tmp
18
19
 
20
+ features/support/fixtures/cassettes/*.yml
19
21
  logs/*.log
20
22
  troo.db
21
23
  tags
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ Documentation:
2
+ Enabled: false
data/Guardfile CHANGED
@@ -1,6 +1,8 @@
1
1
  guard :minitest do
2
2
  watch(%r{^test/(.*)_test\.rb})
3
- watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
3
+ watch(%r{^lib/(.+)\.rb}) do |m|
4
+ "test/lib/#{m[1]}_test.rb"
5
+ end
4
6
  watch(%r{^test/test_helper\.rb}) { 'test' }
5
7
  watch(%r{^test/support/vcr_setup\.rb}) { 'test' }
6
8
  end
data/Rakefile CHANGED
@@ -1,5 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
+ require 'cucumber'
4
+ require 'cucumber/rake/task'
5
+
6
+ Cucumber::Rake::Task.new(:cucumber) do |t|
7
+ t.cucumber_opts = "features --format pretty"
8
+ end
3
9
 
4
10
  Rake::TestTask.new do |t|
5
11
  t.libs << 'lib/troo'
@@ -10,3 +16,4 @@ end
10
16
 
11
17
  task :default => :test
12
18
 
19
+ Rake::Task['cucumber'].execute
data/bin/troo CHANGED
@@ -1,12 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- trap("SIGINT") { exit! }
3
+ trap('INT') { exit! }
4
4
 
5
- require_relative "../lib/troo"
5
+ require_relative '../lib/troo'
6
6
 
7
- begin
8
- puts
9
- Troo::CLI::Main.start(ARGV)
10
- rescue SocketError
11
- puts "Cannot continue, no network connection."
12
- end
7
+ Troo::Launcher.new(ARGV.dup).execute!
data/config/.gitkeep ADDED
File without changes
@@ -0,0 +1,8 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip --tags ~@ok --tags ~@pending"
5
+ %>
6
+ default: <%= std_opts %> features
7
+ wip: --tags @wip:99 --wip features
8
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,26 @@
1
+ Feature: Adding content to Trello
2
+
3
+ @add
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"`
7
+ Then the output should contain:
8
+ """
9
+ New board 'Cuke Add Board' created.
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."
@@ -0,0 +1,34 @@
1
+ Feature: Adding content to Trello
2
+ Background:
3
+ Given a list exists
4
+
5
+ @pending @failing @add
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"`
9
+ Then the output should contain:
10
+ """
11
+ New card 'My Cucumber Card' created
12
+ """
13
+
14
+ @add
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"
25
+ Then the output should contain:
26
+ """
27
+ New card 'My New Exciting Card' created
28
+ """
29
+
30
+ @pending @failing @add
31
+ 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 ""
@@ -0,0 +1,21 @@
1
+ Feature: Adding content to Trello
2
+ Background:
3
+ Given a card exists
4
+
5
+ @pending @failing @add
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 ""
10
+
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
19
+ Scenario: Cannot add a comment as card not found
20
+ When I run `troo add comment 69 ""`
21
+ Then the output should contain ""
@@ -0,0 +1,24 @@
1
+ Feature: Adding content to Trello
2
+ Background:
3
+ Given a board exists
4
+
5
+ @pending @failing @add
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"`
9
+ Then the output should contain:
10
+ """
11
+ New list 'My Cucumber Card' created
12
+ """
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
22
+ Scenario: Cannot add a list as board not found
23
+ When I run `troo add list 69 ""`
24
+ Then the output should contain ""
@@ -0,0 +1,13 @@
1
+ Feature: Removing all local data
2
+
3
+ @pending @cleanup
4
+ Scenario: User confirms removal should occur
5
+ When I run `troo cleanup` interactively
6
+ And I type "yes"
7
+ Then the output should contain "All local data has been removed."
8
+
9
+ @pending @cleanup
10
+ Scenario: User cancels removal
11
+ When I run `troo cleanup` interactively
12
+ And I type "no"
13
+ Then the output should not contain "All local data has been removed."
@@ -0,0 +1,21 @@
1
+ Feature: Setting a default board
2
+
3
+ @default
4
+ Scenario: Set a board to default
5
+ Given a board exists
6
+ When I run `troo default board 1`
7
+ Then the output should contain:
8
+ """
9
+ 'My Test Board' set as default board.
10
+ """
11
+
12
+ @default
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`
16
+ Then the output should contain "Board cannot be found."
17
+
18
+ @default
19
+ Scenario: Cannot set a default; no ID
20
+ When I run `troo default board`
21
+ Then the output should contain "was called with no arguments"
@@ -0,0 +1,21 @@
1
+ Feature: Setting a default card
2
+
3
+ @default
4
+ Scenario: Set a card to default
5
+ Given a card exists
6
+ When I run `troo default card 1`
7
+ Then the output should contain:
8
+ """
9
+ 'My Test Card' set as default card.
10
+ """
11
+
12
+ @default
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`
16
+ Then the output should contain "Card cannot be found."
17
+
18
+ @default
19
+ Scenario: Cannot set a default; no ID
20
+ When I run `troo default card`
21
+ Then the output should contain "was called with no arguments"
@@ -0,0 +1,21 @@
1
+ Feature: Setting a default list
2
+
3
+ @default
4
+ Scenario: Set a list to default
5
+ Given a list exists
6
+ When I run `troo default list 1`
7
+ Then the output should contain:
8
+ """
9
+ 'My Test List' set as default list.
10
+ """
11
+
12
+ @default
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`
16
+ Then the output should contain "List cannot be found."
17
+
18
+ @default
19
+ Scenario: Cannot set a default; no ID
20
+ When I run `troo default list`
21
+ Then the output should contain "was called with no arguments"
@@ -0,0 +1,7 @@
1
+ Feature: Refreshing all data
2
+
3
+ @pending @failing @refresh
4
+ Scenario: Refresh the local data
5
+ Given the Trello API is stubbed with "refresh_all_success"
6
+ When I run `troo refresh all`
7
+ Then the output should contain "All local data refreshed."
@@ -0,0 +1,26 @@
1
+ Feature: Refreshing a resource
2
+
3
+ @refresh
4
+ Scenario: Refresh the board with ID
5
+ Given the Trello API is stubbed with "refresh_board_success"
6
+ And a board exists
7
+ When I run `troo refresh board 1`
8
+ Then the output should contain "refreshed"
9
+
10
+ @refresh
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`
14
+ Then the output should contain "Board cannot be found"
15
+
16
+ @refresh
17
+ Scenario: Refresh the default board
18
+ Given the Trello API is stubbed with "refresh_default_board_success"
19
+ And a default board exists
20
+ When I run `troo refresh board`
21
+ Then the output should contain "refreshed"
22
+
23
+ @refresh
24
+ Scenario: Cannot refresh; no default board
25
+ When I run `troo refresh board`
26
+ Then the output should contain "Default board cannot be found"
@@ -0,0 +1,27 @@
1
+ Feature: Refreshing a card
2
+
3
+ @refresh
4
+ Scenario: Refresh the card with ID
5
+ Given the Trello API is stubbed with "refresh_card_success"
6
+ And a card exists
7
+ When I run `troo refresh card 1`
8
+ Then the output should contain "refreshed"
9
+
10
+ @refresh
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`
14
+ Then the output should contain "Card cannot be found"
15
+
16
+ @refresh
17
+ Scenario: Refresh the default card
18
+ Given the Trello API is stubbed with "refresh_default_card_success"
19
+ And a default card exists
20
+ When I run `troo refresh card`
21
+ Then the output should contain "refreshed"
22
+
23
+ @refresh
24
+ Scenario: Cannot refresh; no default card
25
+ When I run `troo refresh card`
26
+ Then the output should contain "Default card cannot be found"
27
+
@@ -0,0 +1,27 @@
1
+ Feature: Refreshing a resource
2
+
3
+ @refresh
4
+ Scenario: Refresh the list with ID
5
+ Given the Trello API is stubbed with "refresh_list_success"
6
+ And a list exists
7
+ When I run `troo refresh list 1`
8
+ Then the output should contain "refreshed"
9
+
10
+ @refresh
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`
14
+ Then the output should contain "List cannot be found"
15
+
16
+ @refresh
17
+ Scenario: Refresh the default list
18
+ Given the Trello API is stubbed with "refresh_default_list_success"
19
+ And a default list exists
20
+ When I run `troo refresh list`
21
+ Then the output should contain "refreshed"
22
+
23
+ @refresh
24
+ Scenario: Cannot refresh; no default list
25
+ When I run `troo refresh list`
26
+ Then the output should contain "Default list cannot be found"
27
+
@@ -0,0 +1,32 @@
1
+ Feature: Showing a board
2
+
3
+ @show
4
+ Scenario: Showing a board with ID
5
+ Given a board exists
6
+ When I run `troo show board 1`
7
+ Then the output should contain:
8
+ """
9
+ (1) My Test Board
10
+ No lists were found.
11
+ """
12
+
13
+ @show
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`
17
+ Then the output should contain "Board cannot be found."
18
+
19
+ @show
20
+ Scenario: Showing the default board
21
+ Given a default board exists
22
+ When I run `troo show board`
23
+ Then the output should contain:
24
+ """
25
+ * (1) My Default Board
26
+ No lists were found.
27
+ """
28
+
29
+ @show
30
+ Scenario: Cannot show; no default board
31
+ When I run `troo show board`
32
+ Then the output should contain "set a default board first"
@@ -0,0 +1,62 @@
1
+ Feature: Showing a card
2
+ Background:
3
+ Given a board exists
4
+ And a list exists
5
+ And a member exists
6
+
7
+ @show
8
+ Scenario: Showing a card with ID
9
+ Given a card exists
10
+ When I run `troo show card 1`
11
+ Then the output should contain:
12
+ """
13
+ (67) My Test Card
14
+
15
+ Description:
16
+ some description
17
+
18
+ Comments:
19
+ No comments have been left.
20
+
21
+ Members:
22
+ @gavinlaking1
23
+
24
+ Metadata:
25
+ Board: (1) My Test Board
26
+ List: (1) My Test List
27
+ Updated: Tue, Dec 17 at 21:48
28
+ """
29
+
30
+ @show
31
+ Scenario: Cannot show card; not found
32
+ Given the Trello API is stubbed with "fetch_card_by_id"
33
+ When I run `troo show card 69`
34
+ Then the output should contain "Card cannot be found."
35
+
36
+ @show
37
+ Scenario: Showing the default card
38
+ Given a default card exists
39
+ When I run `troo show card`
40
+ Then the output should contain:
41
+ """
42
+ * (67) My Default Card
43
+
44
+ Description:
45
+ some description
46
+
47
+ Comments:
48
+ No comments have been left.
49
+
50
+ Members:
51
+ @gavinlaking1
52
+
53
+ Metadata:
54
+ Board: (1) My Test Board
55
+ List: (1) My Test List
56
+ Updated: Tue, Dec 17 at 21:48
57
+ """
58
+
59
+ @show
60
+ Scenario: Cannot show; no default card
61
+ When I run `troo show card`
62
+ Then the output should contain "set a default card first"
@@ -0,0 +1,39 @@
1
+ Feature: Showing comments
2
+ Background:
3
+ Given a card exists
4
+ And a member exists
5
+
6
+ @show
7
+ Scenario: Showing comments for a card with ID
8
+ Given a comment exists
9
+ When I run `troo show comments 1`
10
+ Then the output should contain "My Test Comment"
11
+
12
+ @show
13
+ Scenario: Showing comments for a card with ID; no comments
14
+ When I run `troo show comments 1`
15
+ Then the output should contain "No comments"
16
+
17
+ @show
18
+ Scenario: Cannot show comments; card not found
19
+ Given the Trello API is stubbed with "fetch_card_by_id"
20
+ When I run `troo show comments 69`
21
+ Then the output should contain "Card cannot be found."
22
+
23
+ @show
24
+ Scenario: Showing the comments for the default card
25
+ Given a default card exists
26
+ And a comment exists
27
+ When I run `troo show comments`
28
+ Then the output should contain:
29
+ """
30
+ * (67) My Default Card
31
+ gavinlaking1:
32
+ My Test Comment
33
+ (Tue, Dec 17 at 22:01)
34
+ """
35
+
36
+ @show
37
+ Scenario: Cannot show comments; no default card
38
+ When I run `troo show comments`
39
+ Then the output should contain "set a default card first"
@@ -0,0 +1,37 @@
1
+ Feature: Showing a list
2
+ Background:
3
+ Given a board exists
4
+ And a card exists
5
+
6
+ @show
7
+ Scenario: Showing a list with ID
8
+ Given a list exists
9
+ When I run `troo show list 1`
10
+ Then the output should contain:
11
+ """
12
+ (1) My Test Board
13
+ (1) My Test List
14
+ (67) My Test Card
15
+ """
16
+
17
+ @show
18
+ Scenario: Cannot show list; not found
19
+ Given the Trello API is stubbed with "fetch_list_by_id"
20
+ When I run `troo show list 69`
21
+ Then the output should contain "List cannot be found."
22
+
23
+ @show
24
+ Scenario: Showing the default list
25
+ Given a default list exists
26
+ When I run `troo show list`
27
+ Then the output should contain:
28
+ """
29
+ (1) My Test Board
30
+ * (1) My Default List
31
+ (67) My Test Card
32
+ """
33
+
34
+ @show
35
+ Scenario: Cannot show; no default list
36
+ When I run `troo show list`
37
+ Then the output should contain "set a default list first"
@@ -1 +1,46 @@
1
- Feature: Getting the local status
1
+ Feature: Showing the current status
2
+
3
+ @status
4
+ Scenario: When there is no local data
5
+ When I run `troo status`
6
+ And the output should contain:
7
+ """
8
+ Status:
9
+ Boards: No boards found.
10
+ Lists: No lists found.
11
+ Cards: No cards found.
12
+ """
13
+
14
+ @status
15
+ Scenario: When there is local data; all defaults set
16
+ Given a default board exists
17
+ And a default list exists
18
+ And a default card exists
19
+ When I run `troo status`
20
+ Then the output should contain:
21
+ """
22
+ Status:
23
+ Boards: 1 board found.
24
+ * (1) My Default Board
25
+ Lists: 1 list found.
26
+ * (1) My Default List
27
+ Cards: 1 card found.
28
+ * (67) My Default Card
29
+ """
30
+
31
+ @status
32
+ Scenario: When there is local data; some defaults set
33
+ Given a default board exists
34
+ And a board exists
35
+ And a default list exists
36
+ And a card exists
37
+ When I run `troo status`
38
+ Then the output should contain:
39
+ """
40
+ Status:
41
+ Boards: 2 boards found.
42
+ * (1) My Default Board
43
+ Lists: 1 list found.
44
+ * (1) My Default List
45
+ Cards: No default card set.
46
+ """
@@ -0,0 +1,34 @@
1
+ require 'fabrication'
2
+ require_relative '../../test/support/fabrication.rb'
3
+
4
+ Given(/^a board exists$/) do
5
+ Fabricate(:board)
6
+ end
7
+
8
+ Given(/^a list exists$/) do
9
+ Fabricate(:list)
10
+ end
11
+
12
+ Given(/^a card exists$/) do
13
+ Fabricate(:card)
14
+ end
15
+
16
+ Given(/^a comment exists$/) do
17
+ Fabricate(:comment)
18
+ end
19
+
20
+ Given(/^a member exists$/) do
21
+ Fabricate(:member)
22
+ end
23
+
24
+ Given(/^a default board exists$/) do
25
+ Fabricate(:board, default: true, name: 'My Default Board')
26
+ end
27
+
28
+ Given(/^a default list exists$/) do
29
+ Fabricate(:list, default: true, name: 'My Default List')
30
+ end
31
+
32
+ Given(/^a default card exists$/) do
33
+ Fabricate(:card, default: true, name: 'My Default Card')
34
+ end
@@ -0,0 +1,16 @@
1
+ Given(/^the Trello API is stubbed with "(.*?)"$/) do |stub|
2
+ VCR.insert_cassette(stub)
3
+ end
4
+
5
+ Then(/^the output should be the version number of troo$/) do
6
+ !!(all_output.match(/#{Troo::VERSION}/))
7
+ end
8
+
9
+ Before do
10
+ Ohm.connect(db: Troo.config.test_db)
11
+ end
12
+
13
+ After do
14
+ Ohm.redis.flushdb
15
+ VCR.eject_cassette
16
+ end