Skip to content

Commit

Permalink
Test fixes, changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
ttscoff committed Oct 29, 2021
1 parent fbf88b4 commit 770f7c4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 2.0.0
### 2.0.0pre1

#### NEW

Expand All @@ -17,6 +17,7 @@
- Use DOING_DEBUG, DOING_QUIET, or DOING_LOG_LEVEL environment variables to specify log levels before configuration is read
- Hooks, register plugins to run based on events
- --[no-]pager and paginate: config option to enable paging output
- Never_finish and never_time config options to prevent items matching tags/sections from ever receiving @done (never_finish) or @done timestamp (never_time) - More configuration refactoring

#### IMPROVED

Expand All @@ -29,7 +30,7 @@
- Output wrapping for terminal display
- Redirect warn to STDOUT when run with --stdout
- Fish autocomplete
- `--config_file` global flag deprecated, now uses $DOING_CONFIG environment variable so that config overrides can be available before the initial configuration is run
- `--config_file` global flag deprected, now uses $DOING_CONFIG environment variable so that config overrides can be available before the initial configuration is run
- When --stdout or not a TTY, no color or output formatting
- Highlight tags when showing results. Because it looks nice.
- --tag and --search for `doing note`
Expand Down
2 changes: 1 addition & 1 deletion bin/doing
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ desc 'Silence info messages'
switch %i[q quiet], default_value: false, negatable: false

desc 'Verbose output'
switch %i[verbose debug], default_value: false, negatable: false
switch %i[debug], default_value: false, negatable: false

desc 'Use a specific configuration file. Deprecated, set $DOING_CONFIG instead.'
flag [:config_file], default_value: config.config_file
Expand Down
2 changes: 1 addition & 1 deletion test/doing_entry_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_section_rejects_empty_args

def test_guess_section
doing('add_section', 'Test Section')
res = doing('--stdout', '--verbose', 'show', 'Test').strip
res = doing('--stdout', '--debug', 'show', 'Test').strip
assert_match(/Assuming "Test Section"/, res, 'Should have guessed Test Section')
end

Expand Down
12 changes: 6 additions & 6 deletions test/doing_import_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def teardown
def test_timing_import
json = JSON.parse(IO.read(@timing_import_file))
target = json.count
result = doing('--stdout', '--verbose', 'import', '--type', 'timing', @timing_import_file)
result = doing('--stdout', '--debug', 'import', '--type', 'timing', @timing_import_file)
assert_match(/Imported: #{target} items/, result, "Should have imported #{target} entries")
result = doing('--stdout', '--verbose', 'import', '--type', 'timing', @timing_import_file)
result = doing('--stdout', '--debug', 'import', '--type', 'timing', @timing_import_file)
assert_match(/Skipped: #{target} items/, result, "Should have skipped #{target} duplicate entries")
end

Expand Down Expand Up @@ -65,23 +65,23 @@ def test_timing_import_no_overlap
json = JSON.parse(IO.read(@timing_import_file))
target = json.count
doing('done', '--back', '2021-07-22 11:20', '--took', '30m', 'Testing overlapping entry')
result = doing('--stdout', '--verbose', 'import', '--type', 'timing', '--no-overlap', @timing_import_file)
result = doing('--stdout', '--debug', 'import', '--type', 'timing', '--no-overlap', @timing_import_file)
assert_match(/Skipped: 1 items/, result, "Should have skipped #{target} duplicate entries")
assert_match(/Imported: #{target - 1} items/, result, "Should have imported #{target - 1} entries")
end

## Doing Import

def test_doing_import
result = doing('--stdout', '--verbose', 'import', '--type', 'doing', @doing_import_file)
result = doing('--stdout', '--debug', 'import', '--type', 'doing', @doing_import_file)
assert_match(/Imported: 126 items/, result, "Should have imported 126 entries")
result = doing('--stdout', '--verbose', 'import', '--type', 'doing', @doing_import_file)
result = doing('--stdout', '--debug', 'import', '--type', 'doing', @doing_import_file)
assert_match(/Skipped: 126 duplicate items/, result, "Should have skipped 126 duplicate entries")
end

def test_doing_import_no_overlap
doing('done', '--back="2021-10-08 13:00"', '--took="30m"', 'Testing overlapping entry')
result = doing('--stdout', '--verbose', 'import', '--type', 'doing', '--no-overlap', @doing_import_file)
result = doing('--stdout', '--debug', 'import', '--type', 'doing', '--no-overlap', @doing_import_file)
assert_match(/Skipped: 1 items/, result, "Should have skipped 1 duplicate entries")
assert_match(/Imported: 125 items/, result, "Should have imported 125 entries")
end
Expand Down
2 changes: 1 addition & 1 deletion test/doing_view_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_view_command
end

def test_view_guess
res = doing('--stdout', '--verbose', 'view', 'col').strip
res = doing('--stdout', '--debug', 'view', 'col').strip
assert_match(/Assuming "color"/, res, 'Should have guessed color')
end

Expand Down

0 comments on commit 770f7c4

Please sign in to comment.