todotxt 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +2 -0
- data/README.md +1 -0
- data/bin/todotxt +3 -3
- data/conf/todotxt.cfg +13 -1
- data/cucumber.yml +3 -0
- data/features/add.feature +24 -0
- data/features/append.feature +28 -0
- data/features/backwards.feature +28 -0
- data/features/colors.feature +51 -0
- data/features/del.feature +52 -0
- data/features/depri.feature +38 -0
- data/features/do.feature +47 -0
- data/features/due.feature +49 -0
- data/features/edit.feature +31 -0
- data/features/generate_config.feature +19 -0
- data/features/generate_txt.feature +20 -0
- data/features/initialize.feature +73 -0
- data/features/list.feature +132 -0
- data/features/move.feature +33 -0
- data/features/prepend.feature +28 -0
- data/features/pri.feature +40 -0
- data/features/replace.feature +28 -0
- data/features/step_definitions/environment_steps.rb +47 -0
- data/features/step_definitions/list_steps.rb +34 -0
- data/features/support/ansi.rb +5 -0
- data/features/support/aruba.rb +9 -0
- data/features/support/debugger.rb +1 -0
- data/features/undo.feature +54 -0
- data/lib/todotxt/cli.rb +131 -45
- data/lib/todotxt/clihelpers.rb +4 -1
- data/lib/todotxt/config.rb +58 -0
- data/lib/todotxt/regex.rb +1 -0
- data/lib/todotxt/todo.rb +5 -0
- data/lib/todotxt/todofile.rb +40 -0
- data/lib/todotxt/todolist.rb +20 -2
- data/lib/todotxt/version.rb +1 -1
- data/lib/todotxt.rb +2 -0
- data/spec/cli_spec.rb +6 -0
- data/spec/config_spec.rb +52 -0
- data/spec/fixtures/config_both.cfg +4 -0
- data/spec/fixtures/config_new.cfg +2 -0
- data/spec/fixtures/config_old.cfg +1 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/todo_spec.rb +12 -0
- data/spec/todofile_spec.rb +31 -0
- data/spec/todolist_spec.rb +20 -2
- data/todotxt.gemspec +4 -0
- metadata +154 -28
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjE5ZGQyNjI2ODg5YzBhNGM3MDBlNjAzZDhkN2I4YTEwMDcxZDA2NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZGY2NmJiOTM2OWUxMzUzMjFkYmZmMzE1NGJlMGQ1OGU2ZWZmZjNhYg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZGU5YTU3YjIwNmU3YTNmNzg4ZTlhNDczMmJjZGI5YTE2OTFkY2JmYTM3MDNm
|
10
|
+
MTBhNjliYThhOTk4YjdmODM1ZGM4MTEyYmQwNzRkMDU0Y2IzNjVjMTg3YjBh
|
11
|
+
ZTdiZDIyMjZiODg3YjAzMzRhZmM0YjdjNGFkYzZmNjA4Y2JlOTI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjFiMTU5YzIxNjMxMTZlZTlhZmIxYTRmZmFkMTAzMzY3NmM2OGQ2NDJjYWY3
|
14
|
+
N2ExMDgwZThjMGJhODk0NmJmNTM5Nzc0N2IxNTJiMWM1ODcwYzY5ZjFlMDAy
|
15
|
+
NWI0MmEwNjcxMzNmMDJlNjZlMWY4ZTM1NGEwNGQwOWEyZDU2YjA=
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -43,6 +43,7 @@ todo.txt.
|
|
43
43
|
todotxt del | rm ITEM#[, ITEM#, ITEM#, ...] # Remove ITEM#
|
44
44
|
todotxt do ITEM#[, ITEM#, ITEM#, ...] # Mark ITEM# as done
|
45
45
|
todotxt dp | depri ITEM#[, ITEM#, ITEM#, ...] # Remove priority for ITEM#
|
46
|
+
todotxt edit # Open todo.txt file in your default editor
|
46
47
|
todotxt generate_txt # Create a sample todo.txt
|
47
48
|
todotxt generate_config # Create a .todotxt.cfg file in your home folder, containing the path to todo.txt
|
48
49
|
todotxt help [TASK] # Describe available tasks or one specific task
|
data/bin/todotxt
CHANGED
data/conf/todotxt.cfg
CHANGED
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
# list files that may contain todo.txt lines.
|
2
|
+
# Obviously, todo.txt is required.
|
3
|
+
# Additionally use for files such as done.txt, deferred.txt or archive.txt.
|
4
|
+
# In contrary to required todo.txt, these will not be
|
5
|
+
# auto-generated for you on initialisation.
|
6
|
+
[files]
|
7
|
+
# Path to your todo.txt file. The only required file.
|
8
|
+
todo = ~/todo.txt
|
9
|
+
done = ""
|
10
|
+
deferred = ""
|
11
|
+
|
12
|
+
# set editor for todotxt, defaults to $EDITOR.
|
13
|
+
# editor = "vim"
|
data/cucumber.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: Add items
|
2
|
+
|
3
|
+
So that I can add new todos
|
4
|
+
As a user
|
5
|
+
I want to insert several new todos
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
And a todofile exists
|
10
|
+
|
11
|
+
Scenario: Adding a todo reports the added todo back to the user
|
12
|
+
When I run `todotxt add "Make Coffee"`
|
13
|
+
Then it should pass with:
|
14
|
+
"""
|
15
|
+
Make Coffee
|
16
|
+
"""
|
17
|
+
|
18
|
+
Scenario: Adding a todo inserts it into the file
|
19
|
+
When I run `todotxt add "Make Coffee"`
|
20
|
+
Then the file "todo.txt" should contain "Make Coffee"
|
21
|
+
|
22
|
+
Scenario: Adding a todo with weird character adds it to the file
|
23
|
+
When I run `todotxt add Äta gul snö`
|
24
|
+
Then the file "todo.txt" should contain "Äta gul snö"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: Append
|
2
|
+
|
3
|
+
So that I can change items
|
4
|
+
As a user
|
5
|
+
I want to append text to an item
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
And a todofile with the following items exists:
|
10
|
+
| todo |
|
11
|
+
| (B) Install todotxt @cli +todotxt |
|
12
|
+
| Drink coffee |
|
13
|
+
|
14
|
+
Scenario: Add text to an item
|
15
|
+
When I run `todotxt append 2 @sofa`
|
16
|
+
Then it should pass with:
|
17
|
+
"""
|
18
|
+
2. Drink coffee @sofa
|
19
|
+
"""
|
20
|
+
And the file "todo.txt" should contain "Drink coffee @sofa"
|
21
|
+
|
22
|
+
|
23
|
+
Scenario: Add text to an illegal item:
|
24
|
+
When I run `todotxt append 1337 @sofa`
|
25
|
+
Then it should pass with:
|
26
|
+
"""
|
27
|
+
ERROR: No todo found at line 1337
|
28
|
+
"""
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: Backwards compatibility
|
2
|
+
|
3
|
+
So that I can continue using todotxt on an older system
|
4
|
+
As a user
|
5
|
+
I want to run todotxt with an old config
|
6
|
+
|
7
|
+
Scenario: Running with an old config-file still works
|
8
|
+
Given an old config exists
|
9
|
+
And a todofile with the following items exists:
|
10
|
+
| todo |
|
11
|
+
| Update my config file |
|
12
|
+
When I run `todotxt`
|
13
|
+
Then it should pass with:
|
14
|
+
"""
|
15
|
+
1. Update my config file
|
16
|
+
"""
|
17
|
+
|
18
|
+
Scenario: Running with an old config-file and option --files fails
|
19
|
+
Given an old config exists
|
20
|
+
And a todofile with the following items exists:
|
21
|
+
| todo |
|
22
|
+
| Update my config file |
|
23
|
+
When I run `todotxt --file=done`
|
24
|
+
Then it should pass with exactly:
|
25
|
+
"""
|
26
|
+
ERROR: You are using an old config, which has no support for mulitple files. Please update your configuration.
|
27
|
+
|
28
|
+
"""
|
@@ -0,0 +1,51 @@
|
|
1
|
+
Feature: Colors and markup
|
2
|
+
|
3
|
+
So that I can glance over my todos
|
4
|
+
As a user
|
5
|
+
I want to see output colored and highlighted
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
Given a todofile with the following items exists:
|
10
|
+
| todo |
|
11
|
+
| Drink Coffee |
|
12
|
+
| Sip Frappucino @buckstar |
|
13
|
+
| Lurk Americano +break |
|
14
|
+
| x brew coffee |
|
15
|
+
| (A) Order coffee |
|
16
|
+
| (B) Pay coffee |
|
17
|
+
| (C) Pick up coffee |
|
18
|
+
| (D) Thank for service |
|
19
|
+
|
20
|
+
@ansi
|
21
|
+
Scenario: See todos with a bright, dark number and uncolored todo-text
|
22
|
+
When I successfully run `todotxt list Drink`
|
23
|
+
Then it should output "1. " brightly in "black"
|
24
|
+
And the output should contain "Drink Coffee"
|
25
|
+
|
26
|
+
@ansi
|
27
|
+
Scenario: See todo-count in bright dark letters
|
28
|
+
When I successfully run `todotxt list Drink`
|
29
|
+
Then it should output "TODO: 1 items" brightly in "black"
|
30
|
+
|
31
|
+
@ansi
|
32
|
+
Scenario: See contexts in blue
|
33
|
+
When I successfully run `todotxt list @buckstar`
|
34
|
+
Then it should output "@buckstar" in "blue"
|
35
|
+
|
36
|
+
@ansi
|
37
|
+
Scenario: See projects in green
|
38
|
+
When I successfully run `todotxt list +break`
|
39
|
+
Then it should output "+break" in "green"
|
40
|
+
|
41
|
+
@ansi
|
42
|
+
Scenario Outline:
|
43
|
+
When I successfully run `todotxt list (<priority>)`
|
44
|
+
Then it should output "(<priority>) " in "<color>"
|
45
|
+
Examples:
|
46
|
+
| priority | color |
|
47
|
+
| A | red |
|
48
|
+
| B | yellow |
|
49
|
+
| C | green |
|
50
|
+
| D | white |
|
51
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
Feature: delete
|
2
|
+
|
3
|
+
So that I can change my mind
|
4
|
+
As a user
|
5
|
+
I want to remove items from the todolist
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
And a todofile with the following items exists:
|
10
|
+
| todo |
|
11
|
+
| (B) Install todotxt @cli +todotxt |
|
12
|
+
| Drink coffee |
|
13
|
+
| x Make coffee |
|
14
|
+
|
15
|
+
Scenario: Remove item with confirmation
|
16
|
+
When I run `todotxt del 2` interactively
|
17
|
+
And I type "Y"
|
18
|
+
Then it should pass with:
|
19
|
+
"""
|
20
|
+
2. Drink coffee
|
21
|
+
Remove this item? [y/N] => Removed from list
|
22
|
+
"""
|
23
|
+
And the file "todo.txt" should not contain "Drink coffee"
|
24
|
+
|
25
|
+
Scenario: Remove several items with confirmation
|
26
|
+
When I run `todotxt del 1 2` interactively
|
27
|
+
And I type "Y"
|
28
|
+
And I type "Y"
|
29
|
+
Then it should pass with:
|
30
|
+
"""
|
31
|
+
1. (B) Install todotxt @cli +todotxt
|
32
|
+
Remove this item? [y/N] => Removed from list
|
33
|
+
2. Drink coffee
|
34
|
+
Remove this item? [y/N] => Removed from list
|
35
|
+
"""
|
36
|
+
And the file "todo.txt" should not contain "(B) Install todotxt @cli +todotxt"
|
37
|
+
And the file "todo.txt" should not contain "Drink coffee"
|
38
|
+
|
39
|
+
Scenario: Remove item without confirmation
|
40
|
+
When I run `todotxt del 2 -f`
|
41
|
+
Then it should pass with:
|
42
|
+
"""
|
43
|
+
2. Drink coffee
|
44
|
+
=> Removed from list
|
45
|
+
"""
|
46
|
+
|
47
|
+
Scenario: Attempt to delete an illegal item
|
48
|
+
When I run `todotxt del 1337`
|
49
|
+
Then it should pass with:
|
50
|
+
"""
|
51
|
+
ERROR: No todo found at line 1337
|
52
|
+
"""
|
@@ -0,0 +1,38 @@
|
|
1
|
+
Feature: Depri, remove priority
|
2
|
+
|
3
|
+
So that I can make tasks less important
|
4
|
+
As a user
|
5
|
+
I want to remove the priorities
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
And a todofile with the following items exists:
|
10
|
+
| todo |
|
11
|
+
| (B) Install todotxt @cli +todotxt |
|
12
|
+
| Drink coffee |
|
13
|
+
|
14
|
+
Scenario: Remove priority of an item
|
15
|
+
When I run `todotxt depri 1`
|
16
|
+
Then it should pass with:
|
17
|
+
"""
|
18
|
+
1. Install todotxt @cli +todotxt
|
19
|
+
"""
|
20
|
+
And the file "todo.txt" should contain exactly:
|
21
|
+
"""
|
22
|
+
Install todotxt @cli +todotxt
|
23
|
+
Drink coffee
|
24
|
+
"""
|
25
|
+
|
26
|
+
Scenario: Remove the priority of an unprioritized item
|
27
|
+
When I run `todotxt depri 2`
|
28
|
+
Then it should pass with:
|
29
|
+
"""
|
30
|
+
2. Drink coffee
|
31
|
+
"""
|
32
|
+
|
33
|
+
Scenario: Remove the priority of an illegal item
|
34
|
+
When I run `todotxt depri 1337`
|
35
|
+
Then it should pass with:
|
36
|
+
"""
|
37
|
+
ERROR: No todo found at line 1337
|
38
|
+
"""
|
data/features/do.feature
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
Feature: Do
|
2
|
+
|
3
|
+
So that I can keep track of progress
|
4
|
+
As a user
|
5
|
+
I want to mark items done
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
Given a todofile with the following items exists:
|
10
|
+
| todo |
|
11
|
+
| 2013-01-01 Install todotxt @cli +todotxt |
|
12
|
+
| Read documentation +todotxt |
|
13
|
+
| 2012-12-12 Buy GTD book @amazon +wishlist |
|
14
|
+
|
15
|
+
Scenario: Mark item done reports that item and marks checked in the file
|
16
|
+
When I run `todotxt do 1`
|
17
|
+
Then it should pass with:
|
18
|
+
"""
|
19
|
+
1. x 2013-01-01 Install todotxt @cli +todotxt
|
20
|
+
"""
|
21
|
+
And the file "todo.txt" should contain:
|
22
|
+
"""
|
23
|
+
x 2013-01-01 Install todotxt @cli +todotxt
|
24
|
+
"""
|
25
|
+
|
26
|
+
Scenario: Mark multiple items done
|
27
|
+
When I run `todotxt do 1 2 3`
|
28
|
+
Then it should pass with:
|
29
|
+
"""
|
30
|
+
1. x 2013-01-01 Install todotxt @cli +todotxt
|
31
|
+
2. x Read documentation +todotxt
|
32
|
+
3. x 2012-12-12 Buy GTD book @amazon +wishlist
|
33
|
+
"""
|
34
|
+
And the file "todo.txt" should contain:
|
35
|
+
"""
|
36
|
+
x 2013-01-01 Install todotxt @cli +todotxt
|
37
|
+
x Read documentation +todotxt
|
38
|
+
x 2012-12-12 Buy GTD book @amazon +wishlist
|
39
|
+
"""
|
40
|
+
|
41
|
+
Scenario: Mark an invalid item done
|
42
|
+
When I run `todotxt do 1337`
|
43
|
+
#Then it should fail with: @TODO: should fail, not pass
|
44
|
+
Then it should pass with:
|
45
|
+
"""
|
46
|
+
No todo found at line 1337
|
47
|
+
"""
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Feature: Due
|
2
|
+
|
3
|
+
So that I can see what needs to be done
|
4
|
+
As a user
|
5
|
+
I want to get a list of due items
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
|
10
|
+
Scenario: Show todays date
|
11
|
+
Given a todofile exists
|
12
|
+
When I run `todotxt due` interactively
|
13
|
+
Then it should pass with todays date
|
14
|
+
|
15
|
+
Scenario: List due items
|
16
|
+
Given the date is "2012-12-12"
|
17
|
+
And a todofile with the following items exists:
|
18
|
+
| todo |
|
19
|
+
| 2012-12-17 Install todotxt @cli +todotxt |
|
20
|
+
| Read documentation +todotxt |
|
21
|
+
| 2012-12-12 Buy GTD book @amazon +wishlist |
|
22
|
+
| 2012-12-19 Evaluate installation +todotxt |
|
23
|
+
When I run `todotxt due` interactively
|
24
|
+
Then it should pass with exactly:
|
25
|
+
"""
|
26
|
+
Due today (2012-12-12)
|
27
|
+
3. 2012-12-12 Buy GTD book @amazon +wishlist
|
28
|
+
|
29
|
+
Past-due items
|
30
|
+
|
31
|
+
Due 7 days in advance
|
32
|
+
1. 2012-12-17 Install todotxt @cli +todotxt
|
33
|
+
4. 2012-12-19 Evaluate installation +todotxt
|
34
|
+
|
35
|
+
"""
|
36
|
+
|
37
|
+
Scenario: list overdue items
|
38
|
+
Given the date is "2012-12-12"
|
39
|
+
And a todofile with the following items exists:
|
40
|
+
| todo |
|
41
|
+
| 2012-12-17 Install todotxt @cli +todotxt |
|
42
|
+
| Read documentation +todotxt |
|
43
|
+
| 2012-11-11 Buy GTD book @amazon +wishlist |
|
44
|
+
When I run `todotxt due` interactively
|
45
|
+
Then it should pass with:
|
46
|
+
"""
|
47
|
+
Past-due items
|
48
|
+
3. 2012-11-11 Buy GTD book @amazon +wishlist
|
49
|
+
"""
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Feature: Edit
|
2
|
+
|
3
|
+
So that I can modify my entire todolist
|
4
|
+
As a user
|
5
|
+
I want to open the todofile in my editor
|
6
|
+
|
7
|
+
|
8
|
+
Background:
|
9
|
+
Given a todofile with the following items exists:
|
10
|
+
| todo |
|
11
|
+
| 2013-01-01 Install todotxt @cli +todotxt |
|
12
|
+
| Read documentation +todotxt |
|
13
|
+
| 2012-12-12 Buy GTD book @amazon +wishlist |
|
14
|
+
|
15
|
+
Scenario: Open the file in the systems editor
|
16
|
+
Given the enviromnent variable "EDITOR" is set to "echo"
|
17
|
+
And a default config exists
|
18
|
+
When I run `todotxt edit`
|
19
|
+
Then it should pass with:
|
20
|
+
"""
|
21
|
+
todo.txt
|
22
|
+
"""
|
23
|
+
|
24
|
+
Scenario: Open the file in the configured editor
|
25
|
+
Given a default config exists with the editor set to "echo"
|
26
|
+
When I run `todotxt edit`
|
27
|
+
Then it should pass with:
|
28
|
+
"""
|
29
|
+
todo.txt
|
30
|
+
"""
|
31
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Feature: Generate config file
|
2
|
+
|
3
|
+
So that I can start using todotxt
|
4
|
+
As a new user
|
5
|
+
I want to create a config file
|
6
|
+
|
7
|
+
Scenario: Generate a config file in an uninitialised environment
|
8
|
+
Given an empty environment
|
9
|
+
When I successfully run `todotxt generate_config`
|
10
|
+
Then a file named ".todotxt.cfg" should exist
|
11
|
+
|
12
|
+
Scenario: Attempt to override an existing config file
|
13
|
+
Given a default config exists
|
14
|
+
When I run `todotxt generate_config` interactively
|
15
|
+
And I type "Y"
|
16
|
+
Then it should pass with regexp:
|
17
|
+
"""
|
18
|
+
Overwrite \/([^/]+\/)+.todotxt.cfg\?
|
19
|
+
"""
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: Generate example todofile
|
2
|
+
|
3
|
+
So that I can start using todotxt
|
4
|
+
As a new user
|
5
|
+
I want to create an example todofile
|
6
|
+
|
7
|
+
Scenario: Generate a config file in an uninitialised environment
|
8
|
+
Given an empty environment
|
9
|
+
When I successfully run `todotxt generate_txt`
|
10
|
+
Then a file named "todo.txt" should exist
|
11
|
+
|
12
|
+
Scenario: Attempt to override an existing config file
|
13
|
+
Given a default config exists
|
14
|
+
And a todofile exists
|
15
|
+
When I run `todotxt generate_txt` interactively
|
16
|
+
And I type "Y"
|
17
|
+
Then it should pass with regexp:
|
18
|
+
"""
|
19
|
+
Overwrite \/([^/]+\/)+todo\.txt\?
|
20
|
+
"""
|
@@ -0,0 +1,73 @@
|
|
1
|
+
Feature: Initialize
|
2
|
+
|
3
|
+
So that I can start using todotxt
|
4
|
+
As a new user
|
5
|
+
I want to set up example files
|
6
|
+
|
7
|
+
Scenario: Completely clean system asks to create both config and todotxt
|
8
|
+
When I run `todotxt` interactively
|
9
|
+
And I type "yes"
|
10
|
+
And I type "yes"
|
11
|
+
Then it should pass with regexp:
|
12
|
+
"""
|
13
|
+
Create \/(.*)\/\.todotxt.cfg\? \[y\/N\]
|
14
|
+
"""
|
15
|
+
And it should pass with regexp:
|
16
|
+
"""
|
17
|
+
Create \/(.*)\/todo.txt\? \[y\/N\]
|
18
|
+
"""
|
19
|
+
|
20
|
+
Scenario: New installation asks and creates a config file
|
21
|
+
When I run `todotxt` interactively
|
22
|
+
And I type "yes"
|
23
|
+
And I type "no"
|
24
|
+
Then it should pass with:
|
25
|
+
"""
|
26
|
+
.todotxt.cfg doesn't exist yet. Would you like to generate a sample file?
|
27
|
+
"""
|
28
|
+
And a file named ".todotxt.cfg" should exist
|
29
|
+
|
30
|
+
Scenario: New installation does not create a config file when I tell it not to
|
31
|
+
When I run `todotxt` interactively
|
32
|
+
And I type "no"
|
33
|
+
Then a file named ".todotxt.cfg" should not exist
|
34
|
+
|
35
|
+
Scenario Outline: New installation does not ask to create for certain options
|
36
|
+
When I run `todotxt <option>`
|
37
|
+
Then the output should not match:
|
38
|
+
"""
|
39
|
+
\[y\/N\] \?
|
40
|
+
"""
|
41
|
+
|
42
|
+
Examples:
|
43
|
+
| option |
|
44
|
+
| help |
|
45
|
+
| generate_config |
|
46
|
+
| generate_txt |
|
47
|
+
|
48
|
+
Scenario: New installation asks and creates a dummy todo.txt
|
49
|
+
Given a default config exists
|
50
|
+
When I run `todotxt` interactively
|
51
|
+
And I type "yes"
|
52
|
+
Then it should pass with:
|
53
|
+
"""
|
54
|
+
todo.txt doesn't exist yet. Would you like to generate a sample file?
|
55
|
+
"""
|
56
|
+
And a file named "todo.txt" should exist
|
57
|
+
|
58
|
+
Scenario: New installation does not create a sample file when I tell it not to
|
59
|
+
Given a default config exists
|
60
|
+
When I run `todotxt` interactively
|
61
|
+
And I type "no"
|
62
|
+
Then a file named "todo.txt" should not exist
|
63
|
+
|
64
|
+
Scenario: Running with an old config-file still works
|
65
|
+
Given an old config exists
|
66
|
+
And a todofile with the following items exists:
|
67
|
+
| todo |
|
68
|
+
| Update my config file |
|
69
|
+
When I run `todotxt`
|
70
|
+
Then it should pass with:
|
71
|
+
"""
|
72
|
+
1. Update my config file
|
73
|
+
"""
|
@@ -0,0 +1,132 @@
|
|
1
|
+
Feature: Listing todos
|
2
|
+
|
3
|
+
So that I can see what I have to do
|
4
|
+
As a the user
|
5
|
+
I want to list and filter my todos.
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given a default config exists
|
9
|
+
And a todofile exists
|
10
|
+
|
11
|
+
Scenario: List is default action
|
12
|
+
When I run `todotxt`
|
13
|
+
Then I should see all entries from the todofile with numbers
|
14
|
+
|
15
|
+
Scenario: Show all entries
|
16
|
+
When I run `todotxt list`
|
17
|
+
Then I should see all entries from the todofile with numbers
|
18
|
+
|
19
|
+
Scenario: Run with alias ls
|
20
|
+
When I run `todotxt ls`
|
21
|
+
Then I should see all entries from the todofile with numbers
|
22
|
+
|
23
|
+
Scenario: Omits done tasks
|
24
|
+
Given a todofile with done items exists
|
25
|
+
When I run `todotxt list`
|
26
|
+
Then the output should not match:
|
27
|
+
"""
|
28
|
+
[\d]\.\s+x
|
29
|
+
"""
|
30
|
+
Scenario: List done tasks
|
31
|
+
Given a todofile with done items exists
|
32
|
+
When I run `todotxt list --done`
|
33
|
+
Then I should see all entries from the todofile with numbers
|
34
|
+
When I run `todotxt list -d`
|
35
|
+
Then I should see all entries from the todofile with numbers
|
36
|
+
|
37
|
+
Scenario: Simple output for scripts
|
38
|
+
When I run `todotxt list --simple`
|
39
|
+
Then I should see all entries from the todofile without formatting
|
40
|
+
|
41
|
+
Scenario Outline:
|
42
|
+
Given a todofile with the following items exists:
|
43
|
+
| todo |
|
44
|
+
| Install todotxt @cli +todotxt |
|
45
|
+
| Read documentation +todotxt |
|
46
|
+
| Buy GTD book @amazon +wishlist |
|
47
|
+
When I run `todotxt list <filter>`
|
48
|
+
Then the output should match /.*<todos>.*/
|
49
|
+
Then it should count <amount> TODO-items
|
50
|
+
|
51
|
+
Examples:
|
52
|
+
| filter | todos | amount |
|
53
|
+
| @cli | Install todotxt | 1 |
|
54
|
+
| +todotxt | Install todotxt .* Read documentation | 2 |
|
55
|
+
| book | Buy GTD book | 1 |
|
56
|
+
| install | Install todotxt | 1 |
|
57
|
+
| "Install todotxt" | Install todotxt | 1 |
|
58
|
+
| foo-bar | | 0 |
|
59
|
+
| "buy install" | | 0 |
|
60
|
+
|
61
|
+
Scenario: List is sorted by priority
|
62
|
+
Given a todofile with the following items exists:
|
63
|
+
| todo |
|
64
|
+
| (B) Install todotxt @cli +todotxt |
|
65
|
+
| Drink coffee |
|
66
|
+
| (A) Read documentation +todotxt |
|
67
|
+
| (C) Buy GTD book @amazon +wishlist |
|
68
|
+
When I run `todotxt list`
|
69
|
+
Then it should pass with:
|
70
|
+
"""
|
71
|
+
3. (A) Read documentation +todotxt
|
72
|
+
1. (B) Install todotxt @cli +todotxt
|
73
|
+
4. (C) Buy GTD book @amazon +wishlist
|
74
|
+
2. Drink coffee
|
75
|
+
"""
|
76
|
+
|
77
|
+
@todo
|
78
|
+
Scenario: List is sorted by date
|
79
|
+
Given a todofile with the following items exists:
|
80
|
+
| todo |
|
81
|
+
| 2013-01-01 Install todotxt @cli +todotxt |
|
82
|
+
| Read documentation +todotxt |
|
83
|
+
| 2012-12-12 Buy GTD book @amazon +wishlist |
|
84
|
+
When I run `todotxt list`
|
85
|
+
Then it should pass with:
|
86
|
+
"""
|
87
|
+
3. 2012-12-12 Buy GTD book @amazon +wishlist
|
88
|
+
1. 2013-01-01 Install todotxt @cli +todotxt
|
89
|
+
2. Read documentation +todotxt
|
90
|
+
"""
|
91
|
+
|
92
|
+
Scenario: List all done items
|
93
|
+
Given a todofile with the following items exists:
|
94
|
+
| todo |
|
95
|
+
| x Buy GTD book @amazon +wishlist |
|
96
|
+
| Install todotxt @cli +todotxt |
|
97
|
+
| x Read documentation +todotxt |
|
98
|
+
When I run `todotxt lsdone`
|
99
|
+
Then it should pass with:
|
100
|
+
"""
|
101
|
+
1. x Buy GTD book @amazon +wishlist
|
102
|
+
3. x Read documentation +todotxt
|
103
|
+
"""
|
104
|
+
Then it should count 2 TODO-items
|
105
|
+
When I run `todotxt lsd`
|
106
|
+
Then it should count 2 TODO-items
|
107
|
+
|
108
|
+
Scenario: List all projects
|
109
|
+
Given a todofile with the following items exists:
|
110
|
+
| todo |
|
111
|
+
| Buy GTD book @amazon +wishlist |
|
112
|
+
| Install todotxt @cli +todotxt |
|
113
|
+
| Read documentation +todotxt |
|
114
|
+
When I run `todotxt lsproj`
|
115
|
+
Then it should pass with:
|
116
|
+
"""
|
117
|
+
+todotxt
|
118
|
+
+wishlist
|
119
|
+
"""
|
120
|
+
|
121
|
+
Scenario: List all contexts
|
122
|
+
Given a todofile with the following items exists:
|
123
|
+
| todo |
|
124
|
+
| Install todotxt @cli +todotxt |
|
125
|
+
| Buy GTD book @amazon +wishlist |
|
126
|
+
| Read documentation +todotxt |
|
127
|
+
When I run `todotxt lscon`
|
128
|
+
Then it should pass with:
|
129
|
+
"""
|
130
|
+
@amazon
|
131
|
+
@cli
|
132
|
+
"""
|