Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress precision #198

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

quasipickle
Copy link

For long running progress bars, seeing it sit at 1% isn't exciting, so I added the ability to change the precision of the percentage.

Usage is straightforward:

$progress = $this->cli->progress(3);
$progress->precision(3);
$progress->current(1);
===>         33.333%

I tried to write a test, but I'm not well versed in unit-testing so this causes an error I'm not sure how to fix:

vendor/bin/phpunit --filter it_can_output_a_progress_bar_with_precision tests/ProgressTest.php
PHPUnit 9.5.27 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 00:00.015, Memory: 6.00 MB

There was 1 error:

=======================>                                                33.3%'). Either the method was unexpected or its arguments matched no expected argument list for this method
Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_2_League_CLImate_Util_Output::write('


/var/www/html/climate/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php:92
/var/www/html/climate/src/TerminalObject/Dynamic/Progress.php:198
/var/www/html/climate/src/TerminalObject/Dynamic/Progress.php:125
/var/www/html/climate/tests/ProgressTest.php:104

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant