[libtest-bdd-cucumber-perl] 05/25: 0.32 release - Clean-up after benningm's PR - Better colour selection - Bump version number - Add docs
Intrigeri
intrigeri at moszumanska.debian.org
Mon Apr 27 09:51:13 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch master
in repository libtest-bdd-cucumber-perl.
commit 57ca3cb24cd1663c9386c3d5421255866ebadc18
Author: Peter Sergeant <pete at clueball.com>
Date: Tue Dec 23 16:22:55 2014 +0700
0.32 release - Clean-up after benningm's PR
- Better colour selection
- Bump version number
- Add docs
---
CHANGES | 6 ++++++
bin/pherkin | 16 ++++++++++++++--
dist.ini | 2 +-
lib/App/pherkin.pm | 2 +-
lib/Test/BDD/Cucumber/Harness/TermColor.pm | 23 ++++++++++++++---------
5 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/CHANGES b/CHANGES
index 0137d70..7b12e1e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,10 @@
-----
+0.32: 23 Dec 2014
+ - Colour themes for TermColor harness, fixes
+ https://github.com/sheriff/test-bdd-cucumber-perl/issues/35
+ - Command-line options are now passed through
+ https://github.com/sheriff/test-bdd-cucumber-perl/pull/49/files
+ - Both of these are based on a patch from benningm
0.31: 09 Oct 2014
- Specified a minimum version of File::Slurp in response to a
private bug report
diff --git a/bin/pherkin b/bin/pherkin
index 94e7520..bc39670 100755
--- a/bin/pherkin
+++ b/bin/pherkin
@@ -26,16 +26,28 @@ is considered to be failing.
=head1 OPTIONS
+Controlling @INC
+
-l, --lib Add 'lib' to @INC
-b, --blib Add 'blib/lib' and 'blib/arch' to @INC
-I [dir] Add given directory to @INC
+
+Output formatting
+
-o, --output Output harness to use. Default to 'TermColor'. See 'Outputs'
+ -c, --theme Colour theme for 'TermColor'. `light` or `dark`. Defaults to `dark`
+
+Tag specifications
+
-t, --tags @tag Run scenarios tagged with '@tag'
-t, --tags @tag1, at tag2 Run scenarios tagged with '@tag1' and '@tag2'
-t, --tags ~@tag Run scenarios tagged without '@tag'
+
+Help
+
+ -h, --help Print usage information.
--i18n LANG List keywords for a particular language.
'--i18n help' lists all languages available.
- -h, --help Print usage information.
=head1 OUTPUTS
@@ -67,6 +79,6 @@ BEGIN {
}
}
-my $result = App::pherkin->new()->run( @ARGV );
+my $result = App::pherkin->new()->run(@ARGV);
exit( $result->result eq 'failing' );
diff --git a/dist.ini b/dist.ini
index 8febd27..f87a7b7 100644
--- a/dist.ini
+++ b/dist.ini
@@ -1,5 +1,5 @@
name = Test-BDD-Cucumber
-version = 0.31
+version = 0.32
abstract = Feature-complete Cucumber-style testing in Perl
main_module = lib/Test/BDD/Cucumber.pm
author = ['Peter Sergeant <pete at clueball.com>','Ben Rogers <ben at bdr.org>']
diff --git a/lib/App/pherkin.pm b/lib/App/pherkin.pm
index 7a5a843..90fe2f8 100644
--- a/lib/App/pherkin.pm
+++ b/lib/App/pherkin.pm
@@ -97,7 +97,7 @@ sub _process_arguments {
local @ARGV = @args;
# Allow -Ilib, -bl
- Getopt::Long::Configure('bundling', 'pass_through');
+ Getopt::Long::Configure( 'bundling', 'pass_through' );
my $includes = [];
my $tags = [];
diff --git a/lib/Test/BDD/Cucumber/Harness/TermColor.pm b/lib/Test/BDD/Cucumber/Harness/TermColor.pm
index d920a7d..c825246 100644
--- a/lib/Test/BDD/Cucumber/Harness/TermColor.pm
+++ b/lib/Test/BDD/Cucumber/Harness/TermColor.pm
@@ -61,6 +61,13 @@ A filehandle to write output to; defaults to C<STDOUT>
has 'fh' => ( is => 'rw', isa => 'FileHandle', default => sub { \*STDOUT } );
+=head2 theme
+
+Name of the theme to use for colours. Defaults to `dark`. Themes are defined
+in the private attribute C<_themes>, and currently include `light` and `dark`
+
+=cut
+
has theme => ( 'is' => 'ro', isa => 'Str', lazy => 1, default => sub {
my $theme = 'dark';
Getopt::Long::Configure('pass_through');
@@ -85,17 +92,15 @@ has _themes => ( is => 'ro', isa => 'HashRef[HashRef]', lazy => 1, default => su
'pending' => 'yellow',
'passing' => 'green',
'failed' => 'red',
- 'step_data' => 'cyan',
+ 'step_data' => 'magenta',
},
}} );
-has _colors => ( is => 'ro', isa => 'HashRef', lazy => 1, default => sub {
- my $self = shift;
- if( ! defined $self->_themes->{$self->theme} ) {
- die('unknown color theme '.$self->theme.'!');
- }
- return( $self->_themes->{$self->theme} );
-} );
+sub _colors {
+ my $self = shift;
+ return $self->_themes->{ $self->theme } ||
+ die('Unknown color theme [' . $self->theme . ']');
+}
my $margin = 2;
@@ -205,7 +210,7 @@ sub step_done {
color => $color,
text => $text,
highlights => $highlights,
- highlight => 'bright_cyan',
+ highlight => $self->_colors->{'step_data'},
trailing => 0,
follow_up => $follow_up,
longest_line => $context->stash->{'scenario'}->{'longest_step_line'}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtest-bdd-cucumber-perl.git
More information about the Pkg-perl-cvs-commits
mailing list