troo 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +2 -0
- data/Guardfile +3 -1
- data/Rakefile +7 -0
- data/bin/troo +3 -8
- data/config/.gitkeep +0 -0
- data/config/cucumber.yml +8 -0
- data/features/add/board.feature +26 -0
- data/features/add/card.feature +34 -0
- data/features/add/comment.feature +21 -0
- data/features/add/list.feature +24 -0
- data/features/cleanup.feature +13 -0
- data/features/default/board.feature +21 -0
- data/features/default/card.feature +21 -0
- data/features/default/list.feature +21 -0
- data/features/refresh/all.feature +7 -0
- data/features/refresh/board.feature +26 -0
- data/features/refresh/card.feature +27 -0
- data/features/refresh/list.feature +27 -0
- data/features/show/board.feature +32 -0
- data/features/show/card.feature +62 -0
- data/features/show/comment.feature +39 -0
- data/features/show/list.feature +37 -0
- data/features/status.feature +46 -1
- data/features/step_definitions/fabrication_steps.rb +34 -0
- data/features/step_definitions/troo_steps.rb +16 -0
- data/features/support/env.rb +22 -24
- data/features/troo.feature +31 -1
- data/lib/troo/actions/create_board.rb +10 -7
- data/lib/troo/actions/create_card.rb +5 -4
- data/lib/troo/actions/create_comment.rb +15 -13
- data/lib/troo/actions/create_list.rb +5 -4
- data/lib/troo/actions/move_card.rb +4 -3
- data/lib/troo/{external/board_adaptor.rb → adaptors/board.rb} +3 -14
- data/lib/troo/{external/card_adaptor.rb → adaptors/card.rb} +4 -15
- data/lib/troo/{external/comment_adaptor.rb → adaptors/comment.rb} +6 -17
- data/lib/troo/{external/list_adaptor.rb → adaptors/list.rb} +3 -14
- data/lib/troo/{external/member_adaptor.rb → adaptors/member.rb} +3 -14
- data/lib/troo/adaptors/resource.rb +17 -0
- data/lib/troo/cli/add.rb +53 -0
- data/lib/troo/cli/default.rb +25 -0
- data/lib/troo/cli/main.rb +46 -0
- data/lib/troo/cli/refresh.rb +31 -0
- data/lib/troo/cli/show.rb +41 -0
- data/lib/troo/cli/thor_fixes.rb +13 -0
- data/lib/troo/commands/add/board.rb +26 -0
- data/lib/troo/commands/add/card.rb +33 -0
- data/lib/troo/commands/add/comment.rb +33 -0
- data/lib/troo/commands/add/list.rb +33 -0
- data/lib/troo/commands/add/resource.rb +21 -0
- data/lib/troo/commands/commands.rb +28 -0
- data/lib/troo/commands/default/board.rb +25 -0
- data/lib/troo/commands/default/card.rb +25 -0
- data/lib/troo/commands/default/list.rb +25 -0
- data/lib/troo/commands/default/resource.rb +26 -0
- data/lib/troo/commands/refresh/all.rb +41 -0
- data/lib/troo/commands/refresh/board.rb +28 -0
- data/lib/troo/commands/refresh/card.rb +29 -0
- data/lib/troo/commands/refresh/list.rb +29 -0
- data/lib/troo/commands/refresh/resource.rb +42 -0
- data/lib/troo/commands/show/board.rb +13 -0
- data/lib/troo/commands/show/boards.rb +35 -0
- data/lib/troo/commands/show/card.rb +13 -0
- data/lib/troo/commands/show/comments.rb +21 -0
- data/lib/troo/commands/show/list.rb +13 -0
- data/lib/troo/commands/show/resource.rb +41 -0
- data/lib/troo/commands/status/board.rb +30 -0
- data/lib/troo/commands/status/card.rb +30 -0
- data/lib/troo/commands/status/list.rb +30 -0
- data/lib/troo/commands/status/resource.rb +34 -0
- data/lib/troo/decorators/board.rb +66 -0
- data/lib/troo/decorators/card.rb +105 -0
- data/lib/troo/decorators/comment.rb +36 -0
- data/lib/troo/decorators/list.rb +60 -0
- data/lib/troo/decorators/member.rb +28 -0
- data/lib/troo/external/board.rb +14 -26
- data/lib/troo/external/card.rb +2 -19
- data/lib/troo/external/comment.rb +5 -23
- data/lib/troo/external/list.rb +2 -20
- data/lib/troo/external/member.rb +2 -20
- data/lib/troo/external/resource.rb +21 -6
- data/lib/troo/helpers/command_helpers.rb +37 -0
- data/lib/troo/{display → helpers}/decorator_helpers.rb +23 -17
- data/lib/troo/{models → helpers}/model_helpers.rb +1 -1
- data/lib/troo/models/behaviours/set_default.rb +49 -0
- data/lib/troo/models/board.rb +10 -7
- data/lib/troo/models/card.rb +33 -15
- data/lib/troo/models/comment.rb +8 -5
- data/lib/troo/models/list.rb +10 -6
- data/lib/troo/models/member.rb +7 -4
- data/lib/troo/models/persistence/board.rb +19 -0
- data/lib/troo/models/persistence/card.rb +19 -0
- data/lib/troo/models/persistence/comment.rb +19 -0
- data/lib/troo/models/persistence/list.rb +19 -0
- data/lib/troo/models/persistence/member.rb +19 -0
- data/lib/troo/models/persistence/resource.rb +50 -0
- data/lib/troo/models/refresh.rb +1 -1
- data/lib/troo/models/remote/comment.rb +21 -0
- data/lib/troo/models/remote/resource.rb +25 -0
- data/lib/troo/models/retrieval/board.rb +29 -0
- data/lib/troo/models/retrieval/card.rb +33 -0
- data/lib/troo/models/retrieval/comment.rb +25 -0
- data/lib/troo/models/retrieval/list.rb +29 -0
- data/lib/troo/models/retrieval/member.rb +25 -0
- data/lib/troo/models/retrieval/resource.rb +36 -0
- data/lib/troo/presentation/sentence.rb +57 -0
- data/lib/troo/presentation/template.rb +4 -3
- data/lib/troo/presenters/board.rb +81 -0
- data/lib/troo/presenters/card.rb +30 -0
- data/lib/troo/presenters/comment.rb +38 -0
- data/lib/troo/presenters/list.rb +44 -0
- data/lib/troo/presenters/member.rb +32 -0
- data/lib/troo/troo.rb +79 -65
- data/lib/troo/version.rb +1 -2
- data/lib/troo.rb +36 -8
- data/test/lib/troo/actions/create_board_test.rb +34 -15
- data/test/lib/troo/actions/create_card_test.rb +35 -18
- data/test/lib/troo/actions/create_comment_test.rb +38 -16
- data/test/lib/troo/actions/create_list_test.rb +31 -15
- data/test/lib/troo/actions/move_card_test.rb +23 -15
- data/test/lib/troo/adaptors/board_test.rb +38 -0
- data/test/lib/troo/adaptors/card_test.rb +49 -0
- data/test/lib/troo/adaptors/comment_test.rb +41 -0
- data/test/lib/troo/adaptors/list_test.rb +38 -0
- data/test/lib/troo/adaptors/member_test.rb +44 -0
- data/test/lib/troo/commands/add/board_test.rb +43 -0
- data/test/lib/troo/commands/add/card_test.rb +44 -0
- data/test/lib/troo/commands/add/comment_test.rb +44 -0
- data/test/lib/troo/commands/add/list_test.rb +44 -0
- data/test/lib/troo/commands/add/resource_test.rb +25 -0
- data/test/lib/troo/commands/default/board_test.rb +37 -0
- data/test/lib/troo/commands/default/card_test.rb +37 -0
- data/test/lib/troo/commands/default/list_test.rb +37 -0
- data/test/lib/troo/commands/default/resource_test.rb +20 -0
- data/test/lib/troo/commands/refresh/all_test.rb +39 -0
- data/test/lib/troo/commands/refresh/board_test.rb +62 -0
- data/test/lib/troo/commands/refresh/card_test.rb +62 -0
- data/test/lib/troo/commands/refresh/list_test.rb +62 -0
- data/test/lib/troo/commands/refresh/resource_test.rb +20 -0
- data/test/lib/troo/commands/show/board_test.rb +65 -0
- data/test/lib/troo/commands/show/boards_test.rb +36 -0
- data/test/lib/troo/commands/show/card_test.rb +64 -0
- data/test/lib/troo/commands/show/comments_test.rb +64 -0
- data/test/lib/troo/commands/show/list_test.rb +64 -0
- data/test/lib/troo/commands/show/resource_test.rb +25 -0
- data/test/lib/troo/commands/status/board_test.rb +43 -0
- data/test/lib/troo/commands/status/card_test.rb +43 -0
- data/test/lib/troo/commands/status/list_test.rb +43 -0
- data/test/lib/troo/commands/status/resource_test.rb +19 -0
- data/test/lib/troo/decorators/board_test.rb +129 -0
- data/test/lib/troo/decorators/card_test.rb +237 -0
- data/test/lib/troo/decorators/comment_test.rb +74 -0
- data/test/lib/troo/decorators/list_test.rb +102 -0
- data/test/lib/troo/decorators/member_test.rb +50 -0
- data/test/lib/troo/external/board_test.rb +74 -41
- data/test/lib/troo/external/card_test.rb +49 -37
- data/test/lib/troo/external/comment_test.rb +43 -33
- data/test/lib/troo/external/list_test.rb +37 -30
- data/test/lib/troo/external/member_test.rb +37 -30
- data/test/lib/troo/external/resource_test.rb +18 -1
- data/test/lib/troo/helpers/command_helpers_test.rb +82 -0
- data/test/lib/troo/{display → helpers}/decorator_helpers_test.rb +6 -6
- data/test/lib/troo/helpers/model_helpers_test.rb +103 -0
- data/test/lib/troo/models/behaviours/set_default_test.rb +54 -0
- data/test/lib/troo/models/board_test.rb +13 -14
- data/test/lib/troo/models/card_test.rb +64 -33
- data/test/lib/troo/models/comment_test.rb +18 -19
- data/test/lib/troo/models/list_test.rb +15 -15
- data/test/lib/troo/models/member_test.rb +18 -18
- data/test/lib/troo/models/persistence/board_test.rb +62 -0
- data/test/lib/troo/models/persistence/card_test.rb +61 -0
- data/test/lib/troo/models/persistence/comment_test.rb +69 -0
- data/test/lib/troo/models/persistence/list_test.rb +60 -0
- data/test/lib/troo/models/persistence/member_test.rb +60 -0
- data/test/lib/troo/models/refresh_test.rb +12 -11
- data/test/lib/troo/models/remote/comment_test.rb +56 -0
- data/test/lib/troo/models/remote/resource_test.rb +26 -0
- data/test/lib/troo/models/retrieval/board_test.rb +93 -0
- data/test/lib/troo/models/retrieval/card_test.rb +101 -0
- data/test/lib/troo/models/retrieval/comment_test.rb +46 -0
- data/test/lib/troo/models/retrieval/list_test.rb +93 -0
- data/test/lib/troo/models/retrieval/member_test.rb +58 -0
- data/test/lib/troo/presentation/sentence_test.rb +57 -0
- data/test/lib/troo/presentation/template_test.rb +17 -16
- data/test/lib/troo/presenters/board_test.rb +79 -0
- data/test/lib/troo/presenters/card_test.rb +41 -0
- data/test/lib/troo/presenters/comment_test.rb +49 -0
- data/test/lib/troo/presenters/list_test.rb +50 -0
- data/test/lib/troo/presenters/member_test.rb +40 -0
- data/test/support/fabrication.rb +31 -32
- data/test/support/vcr_setup.rb +7 -9
- data/test/system_test.sh +55 -0
- data/test/test_helper.rb +10 -10
- data/troo.gemspec +1 -0
- metadata +232 -134
- data/features/add_board.feature +0 -1
- data/features/add_card.feature +0 -1
- data/features/add_comment.feature +0 -1
- data/features/add_list.feature +0 -1
- data/features/move_card_to_list.feature +0 -1
- data/features/refresh.feature +0 -1
- data/features/set_default.feature +0 -7
- data/features/show_board.feature +0 -1
- data/features/show_boards.feature +0 -1
- data/features/show_card.feature +0 -1
- data/features/show_comments.feature +0 -1
- data/features/show_list.feature +0 -1
- data/features/version.feature +0 -8
- data/lib/troo/actions/refresh_all.rb +0 -79
- data/lib/troo/actions/set_default.rb +0 -46
- data/lib/troo/cli/add_cli.rb +0 -83
- data/lib/troo/cli/cli_helpers.rb +0 -34
- data/lib/troo/cli/default_cli.rb +0 -32
- data/lib/troo/cli/main_cli.rb +0 -132
- data/lib/troo/cli/show_cli.rb +0 -64
- data/lib/troo/display/board_decorator.rb +0 -62
- data/lib/troo/display/board_presenter.rb +0 -71
- data/lib/troo/display/card_decorator.rb +0 -100
- data/lib/troo/display/card_presenter.rb +0 -27
- data/lib/troo/display/comment_decorator.rb +0 -33
- data/lib/troo/display/comment_presenter.rb +0 -31
- data/lib/troo/display/list_decorator.rb +0 -57
- data/lib/troo/display/list_presenter.rb +0 -41
- data/lib/troo/display/member_decorator.rb +0 -25
- data/lib/troo/display/member_presenter.rb +0 -59
- data/lib/troo/models/board_persistence.rb +0 -25
- data/lib/troo/models/board_retrieval.rb +0 -45
- data/lib/troo/models/card_persistence.rb +0 -25
- data/lib/troo/models/card_retrieval.rb +0 -49
- data/lib/troo/models/comment_persistence.rb +0 -25
- data/lib/troo/models/comment_retrieval.rb +0 -32
- data/lib/troo/models/list_persistence.rb +0 -25
- data/lib/troo/models/list_retrieval.rb +0 -45
- data/lib/troo/models/member_persistence.rb +0 -25
- data/lib/troo/models/member_retrieval.rb +0 -36
- data/lib/troo/models/persistence.rb +0 -39
- data/test/lib/troo/actions/refresh_all_test.rb +0 -68
- data/test/lib/troo/actions/set_default_test.rb +0 -44
- data/test/lib/troo/cli/add_cli_test.rb +0 -216
- data/test/lib/troo/cli/cli_helpers_test.rb +0 -24
- data/test/lib/troo/cli/default_cli_test.rb +0 -85
- data/test/lib/troo/cli/main_cli_test.rb +0 -234
- data/test/lib/troo/cli/show_cli_test.rb +0 -251
- data/test/lib/troo/display/board_decorator_test.rb +0 -126
- data/test/lib/troo/display/board_presenter_test.rb +0 -77
- data/test/lib/troo/display/card_decorator_test.rb +0 -213
- data/test/lib/troo/display/card_presenter_test.rb +0 -38
- data/test/lib/troo/display/comment_decorator_test.rb +0 -70
- data/test/lib/troo/display/comment_presenter_test.rb +0 -47
- data/test/lib/troo/display/list_decorator_test.rb +0 -98
- data/test/lib/troo/display/list_presenter_test.rb +0 -48
- data/test/lib/troo/display/member_decorator_test.rb +0 -47
- data/test/lib/troo/display/member_presenter_test.rb +0 -70
- data/test/lib/troo/external/board_adaptor_test.rb +0 -36
- data/test/lib/troo/external/card_adaptor_test.rb +0 -50
- data/test/lib/troo/external/comment_adaptor_test.rb +0 -41
- data/test/lib/troo/external/list_adaptor_test.rb +0 -38
- data/test/lib/troo/external/member_adaptor_test.rb +0 -44
- data/test/lib/troo/models/board_persistence_test.rb +0 -61
- data/test/lib/troo/models/board_retrieval_test.rb +0 -93
- data/test/lib/troo/models/card_persistence_test.rb +0 -60
- data/test/lib/troo/models/card_retrieval_test.rb +0 -101
- data/test/lib/troo/models/comment_persistence_test.rb +0 -65
- data/test/lib/troo/models/comment_retrieval_test.rb +0 -46
- data/test/lib/troo/models/list_persistence_test.rb +0 -60
- data/test/lib/troo/models/list_retrieval_test.rb +0 -93
- data/test/lib/troo/models/member_persistence_test.rb +0 -59
- data/test/lib/troo/models/member_retrieval_test.rb +0 -58
- data/test/lib/troo/models/model_helpers_test.rb +0 -103
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cf7d75305007bbed1c23aa79c3f33230d9ed81a
|
4
|
+
data.tar.gz: 46d9a18e57dbba06a2352f6fc39f7dfdd7133159
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a9b909ea4d6d641703b2e41ee7be9f9dacd5550e4c38e2f3c17274b7145909c889fe51bc3ccc885051c62fa78df667392a943e64720bc70526a2d7cd337dc39
|
7
|
+
data.tar.gz: 5068ac55e7be3ea02fa13eb48a39b3b681d279d546d0a9643b8184df46ac05b72ebfe967b71e5d28c394a89a7ba98edf9fff6af9a2e4a050dc4462d17f78aca4
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
data/Guardfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
guard :minitest do
|
2
2
|
watch(%r{^test/(.*)_test\.rb})
|
3
|
-
watch(%r{^lib/(.+)\.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(
|
3
|
+
trap('INT') { exit! }
|
4
4
|
|
5
|
-
require_relative
|
5
|
+
require_relative '../lib/troo'
|
6
6
|
|
7
|
-
|
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
|
data/config/cucumber.yml
ADDED
@@ -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 ""
|
data/features/cleanup.feature
CHANGED
@@ -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,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"
|
data/features/status.feature
CHANGED
@@ -1 +1,46 @@
|
|
1
|
-
Feature:
|
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
|