This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libtest-bdd-cucumber-perl.

commit 1d3fe9f9eed3d17338338fc37078db421b8b454c
Author: gregor herrmann <gre...@debian.org>
Date:   Sat Jun 7 14:55:24 2014 +0200

    Imported Upstream version 0.24
---
 CHANGES                                       |   6 ++
 MANIFEST                                      |   4 +-
 META.yml                                      |   7 +-
 Makefile.PL                                   |   6 +-
 README                                        |   2 +-
 TODO                                          |   1 -
 bin/pherkin                                   |   2 +-
 dist.ini                                      |  15 ++-
 lib/App/pherkin.pm                            |  35 ++++---
 lib/Test/BDD/Cucumber.pm                      |   4 +-
 lib/Test/BDD/Cucumber/Errors.pm               | 133 +++++++++++++++++++++++++
 lib/Test/BDD/Cucumber/Executor.pm             |   4 +-
 lib/Test/BDD/Cucumber/Harness.pm              |   4 +-
 lib/Test/BDD/Cucumber/Harness/Data.pm         |   4 +-
 lib/Test/BDD/Cucumber/Harness/TermColor.pm    |   6 +-
 lib/Test/BDD/Cucumber/Harness/TestBuilder.pm  |   4 +-
 lib/Test/BDD/Cucumber/I18N/Data.pm            |   5 +-
 lib/Test/BDD/Cucumber/I18n.pm                 |  40 +++++++-
 lib/Test/BDD/Cucumber/Loader.pm               |   4 +-
 lib/Test/BDD/Cucumber/Manual/Architecture.pod |   4 +-
 lib/Test/BDD/Cucumber/Manual/Integration.pod  |   4 +-
 lib/Test/BDD/Cucumber/Manual/Steps.pod        |   4 +-
 lib/Test/BDD/Cucumber/Manual/Tutorial.pod     |   4 +-
 lib/Test/BDD/Cucumber/Model/Document.pm       |   4 +-
 lib/Test/BDD/Cucumber/Model/Feature.pm        |   4 +-
 lib/Test/BDD/Cucumber/Model/Line.pm           |   4 +-
 lib/Test/BDD/Cucumber/Model/Result.pm         |   4 +-
 lib/Test/BDD/Cucumber/Model/Scenario.pm       |   4 +-
 lib/Test/BDD/Cucumber/Model/Step.pm           |   4 +-
 lib/Test/BDD/Cucumber/Model/TagSpec.pm        |   4 +-
 lib/Test/BDD/Cucumber/Parser.pm               |  31 +++---
 lib/Test/BDD/Cucumber/StepContext.pm          |   4 +-
 lib/Test/BDD/Cucumber/StepFile.pm             |   4 +-
 lib/Test/BDD/Cucumber/Util.pm                 |   4 +-
 t/400_app_pherkin_harnesses.t                 |  26 +++++
 t/500_error_formatter.t                       | 135 ++++++++++++++++++++++++++
 t/release-pod-coverage.t                      |  15 ---
 37 files changed, 445 insertions(+), 104 deletions(-)

diff --git a/CHANGES b/CHANGES
index 7c9151c..c74fe71 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,10 @@
 -----
+0.24: 07 Jun 2014
+    - Replacing string `eval` with block `eval` for requiring test harnesses -
+      thanks Paul Cochrane
+    - Module metadata now points to repository and bug tracker - thanks Peter
+      Rabbitson
+    - Removed Ouch
 0.23: 05 Jun 2014
     - Another attempt to fix up the weird regex test bug
     - Remove our experiment with ShareDir
diff --git a/MANIFEST b/MANIFEST
index 83a9bd0..f39a5d2 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -21,6 +21,7 @@ examples/tagged-digest/features/basic.feature
 examples/tagged-digest/features/step_definitions/basic_steps.pl
 lib/App/pherkin.pm
 lib/Test/BDD/Cucumber.pm
+lib/Test/BDD/Cucumber/Errors.pm
 lib/Test/BDD/Cucumber/Executor.pm
 lib/Test/BDD/Cucumber/Harness.pm
 lib/Test/BDD/Cucumber/Harness/Data.pm
@@ -51,6 +52,8 @@ t/230_tag_matching.t
 t/240-localized-features.t
 t/250-i18n-json.t
 t/310_auto_corpus.t
+t/400_app_pherkin_harnesses.t
+t/500_error_formatter.t
 t/700_tag_processing.t
 t/800_regressions_010_too_few_features.t
 t/900_run_cucumber_tests.t
@@ -66,5 +69,4 @@ t/old/030_pherkin_010_sanity.t.old
 t/old/900_run_features.t.old
 t/regressions/010_greedy_table_parsing/test.feature
 t/regressions/010_greedy_table_parsing/test_steps.pl
-t/release-pod-coverage.t
 t/release-pod-syntax.t
diff --git a/META.yml b/META.yml
index d6075de..42f3721 100644
--- a/META.yml
+++ b/META.yml
@@ -21,8 +21,8 @@ requires:
   JSON::MaybeXS: '0'
   List::MoreUtils: '0'
   List::Util: '0'
+  Module::Runtime: '0'
   Moose: '0'
-  Ouch: '0'
   Path::Class: '0'
   Storable: '0'
   Term::ANSIColor: '3.00'
@@ -30,4 +30,7 @@ requires:
   Test::Differences: '0'
   Test::More: '0'
   YAML::Syck: '0'
-version: '0.23'
+resources:
+  bugtracker: https://github.com/sheriff/test-bdd-cucumber-perl/issues
+  repository: https://github.com/sheriff/test-bdd-cucumber-perl.git
+version: '0.24'
diff --git a/Makefile.PL b/Makefile.PL
index 8d5e943..bc9f050 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -31,8 +31,8 @@ my %WriteMakefileArgs = (
     "JSON::MaybeXS" => 0,
     "List::MoreUtils" => 0,
     "List::Util" => 0,
+    "Module::Runtime" => 0,
     "Moose" => 0,
-    "Ouch" => 0,
     "Path::Class" => 0,
     "Storable" => 0,
     "Term::ANSIColor" => "3.00",
@@ -42,7 +42,7 @@ my %WriteMakefileArgs = (
     "YAML::Syck" => 0
   },
   "TEST_REQUIRES" => {},
-  "VERSION" => "0.23",
+  "VERSION" => "0.24",
   "test" => {
     "TESTS" => "t/*.t"
   }
@@ -58,8 +58,8 @@ my %FallbackPrereqs = (
   "JSON::MaybeXS" => 0,
   "List::MoreUtils" => 0,
   "List::Util" => 0,
+  "Module::Runtime" => 0,
   "Moose" => 0,
-  "Ouch" => 0,
   "Path::Class" => 0,
   "Storable" => 0,
   "Term::ANSIColor" => "3.00",
diff --git a/README b/README
index e0d784c..30eb158 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Test-BDD-Cucumber,
-version 0.23:
+version 0.24:
 
   Feature-complete Cucumber-style testing in Perl
 
diff --git a/TODO b/TODO
index 1b6dc66..238603e 100644
--- a/TODO
+++ b/TODO
@@ -13,7 +13,6 @@
 - [ ] Add support for explicit outlines
 - [ ] Simplify Parser
 - [ ] Add a jUnit outputer
-- [ ] Remove Ouch
 - [ ] Fix indentation
 - [ ] Quoting in tables is broken
 - [ ] Placeholders in Pystrings
diff --git a/bin/pherkin b/bin/pherkin
index 1263a01..8c96b00 100755
--- a/bin/pherkin
+++ b/bin/pherkin
@@ -6,7 +6,7 @@ pherkin - Execute tests written using Test::BDD::Cucumber
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 SYNOPSIS
 
diff --git a/dist.ini b/dist.ini
index a2cfba2..de0d179 100644
--- a/dist.ini
+++ b/dist.ini
@@ -1,5 +1,5 @@
 name      = Test-BDD-Cucumber
-version   = 0.23
+version   = 0.24
 abstract  = Feature-complete Cucumber-style testing in Perl
 main_module = lib/Test/BDD/Cucumber.pm
 author    = ['Peter Sergeant <p...@clueball.com>','Ben Rogers <b...@bdr.org>']
@@ -7,7 +7,16 @@ license   = Perl_5
 is_trial  = 0
 copyright_holder = Peter Sergeant
 
-[@Classic]
+[MetaResources]
+bugtracker.web    = https://github.com/sheriff/test-bdd-cucumber-perl/issues
+repository.url    = https://github.com/sheriff/test-bdd-cucumber-perl.git
+repository.web    = https://github.com/sheriff/test-bdd-cucumber-perl
+repository.type   = git
+
+[@Basic]
+[PkgVersion]
+[PodVersion]
+[PodSyntaxTests]
 
 [Prereqs]
 Clone = 0
@@ -18,8 +27,8 @@ File::Slurp = 0
 FindBin::libs = 0
 Getopt::Long = 0
 JSON::MaybeXS = 0
+Module::Runtime = 0
 Moose = 0
-Ouch = 0
 Path::Class = 0
 Storable = 0
 Term::ANSIColor = 3.00
diff --git a/lib/App/pherkin.pm b/lib/App/pherkin.pm
index a13d6a7..bf73fb7 100644
--- a/lib/App/pherkin.pm
+++ b/lib/App/pherkin.pm
@@ -1,13 +1,16 @@
 package App::pherkin;
-$App::pherkin::VERSION = '0.23';
+$App::pherkin::VERSION = '0.24';
 use strict;
 use warnings;
 
 use FindBin::libs;
 use Getopt::Long;
-use Test::BDD::Cucumber::I18n qw(languages langdef readable_keywords 
keyword_to_subname);
+use Module::Runtime qw(use_module);
 use List::Util qw(max);
 
+use Test::BDD::Cucumber::I18n qw(languages langdef readable_keywords 
keyword_to_subname);
+use Test::BDD::Cucumber::Loader;
+
 use Moose;
 has 'tags' => ( is => 'rw', isa => 'ArrayRef', required => 0 );
 has 'tag_scheme' => ( is => 'rw', isa => 'ArrayRef', required => 0 );
@@ -18,7 +21,7 @@ App::pherkin - Run Cucumber tests from the command line
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 SYNOPSIS
 
@@ -36,10 +39,6 @@ Steps that pass will be printed in green, those that fail in 
red, and those
 for which there is no step definition as yellow (for TODO), assuming you're
 using the default output harness.
 
-=cut
-
-use Test::BDD::Cucumber::Loader;
-
 =head1 METHODS
 
 =head2 run
@@ -65,9 +64,7 @@ sub run {
     );
     die "No feature files found" unless @features;
 
-    eval "require $options->{'harness'}" || die $@;
-    my $harness  = $options->{'harness'}->new();
-    $harness->startup();
+    my $harness = $self->_load_harness( $options->{'harness'} );
 
     my $tag_spec;
     if ($self->tag_scheme) {
@@ -80,6 +77,22 @@ sub run {
     return $harness->result;
 }
 
+sub _load_harness {
+    my ( $self, $harness_module ) = @_;
+
+    unless ( $harness_module =~ m/::/ ) {
+        $harness_module = "Test::BDD::Cucumber::Harness::" . $harness_module;
+    }
+
+    eval { use_module( $harness_module ) } ||
+        die "Unable to load harness [$harness_module]: $@";
+
+    my $harness = $harness_module->new();
+    $harness->startup();
+
+    return $harness;
+}
+
 sub _process_arguments {
     my ( $self, @args ) = @_;
     local @ARGV = @args;
@@ -108,8 +121,6 @@ sub _process_arguments {
 
     # Munge the output harness
     $harness //= "TermColor";
-    $harness = "Test::BDD::Cucumber::Harness::$harness" unless
-        $harness =~ m/\:\:/;
 
     lib->import(@$includes) if @$includes;
 
diff --git a/lib/Test/BDD/Cucumber.pm b/lib/Test/BDD/Cucumber.pm
index 0d7ad07..4df7bb3 100644
--- a/lib/Test/BDD/Cucumber.pm
+++ b/lib/Test/BDD/Cucumber.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber;
-$Test::BDD::Cucumber::VERSION = '0.23';
+$Test::BDD::Cucumber::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber - Feature-complete Cucumber-style testing in Perl
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Errors.pm b/lib/Test/BDD/Cucumber/Errors.pm
new file mode 100644
index 0000000..dea85f1
--- /dev/null
+++ b/lib/Test/BDD/Cucumber/Errors.pm
@@ -0,0 +1,133 @@
+package Test::BDD::Cucumber::Errors;
+$Test::BDD::Cucumber::Errors::VERSION = '0.24';
+use strict;
+use warnings;
+
+require Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(parse_error_from_line);
+
+=head1 NAME
+
+Test::BDD::Cucumber::Errors - Consistently formatted errors
+
+=head1 VERSION
+
+version 0.24
+
+=head1 DESCRIPTION
+
+Consistently formatted errors
+
+=head1 NOTE
+
+This module is not intended to help throw error classes, simply to provide
+helpers for consistently formatting certain errors. Most of the errors thrown 
in
+practice are errors with the input test scenarios, and it's helpful to have the
+location of the error and context when debugging those. Perhaps in the future
+these can return error objects.
+
+=head1 SYNOPSIS
+
+  use Test::BDD::Cucumber::Errors qw/parse_error_from_line/;
+
+  parse_error_from_line(
+    "Your input was bad",
+    $line
+  );
+
+=head1 PARSER ERRORS
+
+=head2 parse_error_from_line
+
+Generates a parser error from a L<Test::BDD::Cucumber::Model::Line> object, and
+error reason:
+
+  parse_error_from_line(
+    "Your input was bad",
+    $line
+  );
+
+=cut
+
+sub parse_error_from_line {
+    my ( $message, $line ) = @_;
+
+    my $error  = "-- Parse Error --\n\n $message\n";
+       $error .= "  at [%s] line %d\n";
+       $error .= "  thrown by: [%s] line %d\n\n";
+       $error .= "-- [%s] --\n\n";
+       $error .= "%s";
+       $error .= "\n%s\n";
+
+    # Get the caller data
+    my ( $caller_filename, $caller_line ) = (caller())[1,2];
+
+    # Get the simplistic filename and line number it occured on
+    my $feature_filename = $line->document->filename || "(no filename)";
+    my $feature_line = $line->number;
+
+    # Get the context lines
+    my ( $start_line, @lines ) =
+        _get_context_range( $line->document, $feature_line );
+
+    my $formatted_lines;
+    for ( 0 .. 4 ) {
+        my $actual_line = $start_line + $_;
+        my $mark = ($feature_line == $actual_line) ? '*' : '|';
+        $formatted_lines .=
+            sprintf("% 3d%s    %s\n",
+                $actual_line, $mark, $lines[$_]
+            );
+    }
+
+    return(
+        sprintf( $error,
+            $feature_filename, $feature_line,
+            $caller_filename, $caller_line,
+            $feature_filename, $formatted_lines,
+            ('-' x ((length $feature_filename) + 8))
+        )
+    );
+}
+
+sub _get_context_range {
+    my ( $document, $number ) = @_;
+
+    # Context range
+    my $min_range = 1;
+    my $max_range = (scalar @{$document->lines});
+
+    my @range = (
+        $number - 2, $number - 1,
+        $number,
+        $number + 1, $number + 2
+    );
+
+    # Push the range higher if needed
+    while ( $range[0] < $min_range ) {
+        @range = map { $_+1 } @range;
+    }
+
+    # Push the range lower if needed
+    while ( $range[4] > $max_range ) {
+        @range = map { $_-1 } @range;
+    }
+
+    # Then cut it off
+    @range = grep { $_ >= $min_range } @range;
+
+    return( $range[0], map { $document->lines->[$_ - 1]->raw_content } @range 
);
+}
+
+=head1 AUTHOR
+
+Peter Sergeant C<p...@clueball.com>
+
+=head1 LICENSE
+
+Copyright 2014, Peter Sergeant; Licensed under the same terms as Perl
+
+=cut
+
+1;
diff --git a/lib/Test/BDD/Cucumber/Executor.pm 
b/lib/Test/BDD/Cucumber/Executor.pm
index d70422c..d1b66df 100644
--- a/lib/Test/BDD/Cucumber/Executor.pm
+++ b/lib/Test/BDD/Cucumber/Executor.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Executor;
-$Test::BDD::Cucumber::Executor::VERSION = '0.23';
+$Test::BDD::Cucumber::Executor::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Executor - Run through Feature and Harness objects
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Harness.pm b/lib/Test/BDD/Cucumber/Harness.pm
index c750a1c..8177987 100644
--- a/lib/Test/BDD/Cucumber/Harness.pm
+++ b/lib/Test/BDD/Cucumber/Harness.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Harness;
-$Test::BDD::Cucumber::Harness::VERSION = '0.23';
+$Test::BDD::Cucumber::Harness::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Harness - Base class for creating harnesses
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Harness/Data.pm 
b/lib/Test/BDD/Cucumber/Harness/Data.pm
index e12aa25..02ad870 100644
--- a/lib/Test/BDD/Cucumber/Harness/Data.pm
+++ b/lib/Test/BDD/Cucumber/Harness/Data.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Harness::Data;
-$Test::BDD::Cucumber::Harness::Data::VERSION = '0.23';
+$Test::BDD::Cucumber::Harness::Data::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Harness::Data - Builds up an internal data representation 
of test passes / failures
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Harness/TermColor.pm 
b/lib/Test/BDD/Cucumber/Harness/TermColor.pm
index f95d2cd..66873cf 100644
--- a/lib/Test/BDD/Cucumber/Harness/TermColor.pm
+++ b/lib/Test/BDD/Cucumber/Harness/TermColor.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Harness::TermColor;
-$Test::BDD::Cucumber::Harness::TermColor::VERSION = '0.23';
+$Test::BDD::Cucumber::Harness::TermColor::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Harness::TermColor - Prints colorized text to the screen
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
@@ -33,7 +33,7 @@ BEGIN {
         (! $ENV{'DISABLE_WIN32_FALLBACK'} )
     ) {
         # Try and load
-        eval "require Win32::Console::ANSI";
+        eval { require Win32::Console::ANSI };
         if ( $@ ) {
             print "# Install Win32::Console::ANSI to display colors 
properly\n";
         }
diff --git a/lib/Test/BDD/Cucumber/Harness/TestBuilder.pm 
b/lib/Test/BDD/Cucumber/Harness/TestBuilder.pm
index afa0754..32cfa71 100644
--- a/lib/Test/BDD/Cucumber/Harness/TestBuilder.pm
+++ b/lib/Test/BDD/Cucumber/Harness/TestBuilder.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Harness::TestBuilder;
-$Test::BDD::Cucumber::Harness::TestBuilder::VERSION = '0.23';
+$Test::BDD::Cucumber::Harness::TestBuilder::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Harness::TestBuilder - Pipes step output via Test::Builder
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/I18N/Data.pm 
b/lib/Test/BDD/Cucumber/I18N/Data.pm
index a5020f6..a747040 100644
--- a/lib/Test/BDD/Cucumber/I18N/Data.pm
+++ b/lib/Test/BDD/Cucumber/I18N/Data.pm
@@ -1,10 +1,11 @@
 package Test::BDD::Cucumber::I18N::Data;
-$Test::BDD::Cucumber::I18N::Data::VERSION = '0.23';
+$Test::BDD::Cucumber::I18N::Data::VERSION = '0.24';
 use strict;
 use warnings;
 
 use JSON::MaybeXS qw/decode_json/;
 
+=encoding utf8
 
 =head1 NAME
 
@@ -12,7 +13,7 @@ Test::BDD::Cucumber::I18N::Data - Cucumber language 
definitions
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/I18n.pm b/lib/Test/BDD/Cucumber/I18n.pm
index 327221e..93cadfb 100644
--- a/lib/Test/BDD/Cucumber/I18n.pm
+++ b/lib/Test/BDD/Cucumber/I18n.pm
@@ -1,12 +1,14 @@
 package Test::BDD::Cucumber::I18n;
-$Test::BDD::Cucumber::I18n::VERSION = '0.23';
+$Test::BDD::Cucumber::I18n::VERSION = '0.24';
+=encoding utf8
+
 =head1 NAME
 
 Test::BDD::Cucumber::I18N - Internationalization
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
@@ -58,15 +60,37 @@ sub _initialize_language_definitions_from_shared_json_file {
     return $langdefs;
 }
 
+=head1 METHODS
+
+=head2 languages
+
+Get codes of supported languages.
+
+=cut
+
 sub languages {
     return keys %$langdefs;
 }
 
+=head2 has_language($language)
+
+Check if a language is supported.  Takes as argument the language
+abbreviation defined in C<share/i18n.json>.
+
+=cut
+
 sub has_language {
     my ($language) = @_;
     exists $langdefs->{$language};
 }
 
+=head2 langdef($language)
+
+Get definition of a language.  Takes as argument the language abbreviation
+defined in C<share/i18n.json>.
+
+=cut
+
 sub langdef {
     my ($language) = @_;
 
@@ -74,6 +98,12 @@ sub langdef {
     return $langdefs->{$language};
 }
 
+=head2 readable_keywords($string, $transform)
+
+Get readable keyword definitions.
+
+=cut
+
 sub readable_keywords {
     my ( $string, $transform ) = @_;
 
@@ -84,6 +114,12 @@ sub readable_keywords {
     return join( ', ', map { '"' . $_ . '"' } @keywords );
 }
 
+=head2 keyword_to_subname
+
+Return a keyword into a subname with non-word characters removed.
+
+=cut
+
 sub keyword_to_subname {
     my ($word) = @_;
 
diff --git a/lib/Test/BDD/Cucumber/Loader.pm b/lib/Test/BDD/Cucumber/Loader.pm
index 2b1a4e1..d452093 100644
--- a/lib/Test/BDD/Cucumber/Loader.pm
+++ b/lib/Test/BDD/Cucumber/Loader.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Loader;
-$Test::BDD::Cucumber::Loader::VERSION = '0.23';
+$Test::BDD::Cucumber::Loader::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Loader - Simplify loading of Step Definition and feature 
files
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Manual/Architecture.pod 
b/lib/Test/BDD/Cucumber/Manual/Architecture.pod
index c07a79d..7208936 100644
--- a/lib/Test/BDD/Cucumber/Manual/Architecture.pod
+++ b/lib/Test/BDD/Cucumber/Manual/Architecture.pod
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Manual::Architecture;
-$Test::BDD::Cucumber::Manual::Architecture::VERSION = '0.23';
+$Test::BDD::Cucumber::Manual::Architecture::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Manual::Architecture - Structural Overview
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 INTRODUCTION
 
diff --git a/lib/Test/BDD/Cucumber/Manual/Integration.pod 
b/lib/Test/BDD/Cucumber/Manual/Integration.pod
index 2b6943e..3d7654e 100644
--- a/lib/Test/BDD/Cucumber/Manual/Integration.pod
+++ b/lib/Test/BDD/Cucumber/Manual/Integration.pod
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Manual::Integration;
-$Test::BDD::Cucumber::Manual::Integration::VERSION = '0.23';
+$Test::BDD::Cucumber::Manual::Integration::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Manual::Integration - Integrating with Test::Builder
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Manual/Steps.pod 
b/lib/Test/BDD/Cucumber/Manual/Steps.pod
index e923629..235e275 100644
--- a/lib/Test/BDD/Cucumber/Manual/Steps.pod
+++ b/lib/Test/BDD/Cucumber/Manual/Steps.pod
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Manual::Steps;
-$Test::BDD::Cucumber::Manual::Steps::VERSION = '0.23';
+$Test::BDD::Cucumber::Manual::Steps::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Manual::Steps - How to write Step Definitions
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 INTRODUCTION
 
diff --git a/lib/Test/BDD/Cucumber/Manual/Tutorial.pod 
b/lib/Test/BDD/Cucumber/Manual/Tutorial.pod
index dd8b1cc..82d4baf 100644
--- a/lib/Test/BDD/Cucumber/Manual/Tutorial.pod
+++ b/lib/Test/BDD/Cucumber/Manual/Tutorial.pod
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::Manual::Tutorial
-$Test::BDD::Cucumber::Manual::Tutorial::VERSION = '0.23';
+$Test::BDD::Cucumber::Manual::Tutorial::VERSION = '0.24';
 =encoding utf8
 
 =head1 NAME
@@ -8,7 +8,7 @@ Test::BDD::Cucumber::Manual::Tutorial - Quick Start Guide
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 Introduction
 
diff --git a/lib/Test/BDD/Cucumber/Model/Document.pm 
b/lib/Test/BDD/Cucumber/Model/Document.pm
index 10cea5a..00fa360 100644
--- a/lib/Test/BDD/Cucumber/Model/Document.pm
+++ b/lib/Test/BDD/Cucumber/Model/Document.pm
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::Model::Document;
-$Test::BDD::Cucumber::Model::Document::VERSION = '0.23';
+$Test::BDD::Cucumber::Model::Document::VERSION = '0.24';
 use Moose;
 use Test::BDD::Cucumber::Model::Line;
 
@@ -9,7 +9,7 @@ Test::BDD::Cucumber::Model::Document - Model to represent a 
feature file on disk
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Model/Feature.pm 
b/lib/Test/BDD/Cucumber/Model/Feature.pm
index a8eb10e..4a6cd6a 100644
--- a/lib/Test/BDD/Cucumber/Model/Feature.pm
+++ b/lib/Test/BDD/Cucumber/Model/Feature.pm
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::Model::Feature;
-$Test::BDD::Cucumber::Model::Feature::VERSION = '0.23';
+$Test::BDD::Cucumber::Model::Feature::VERSION = '0.24';
 use Moose;
 
 =head1 NAME
@@ -8,7 +8,7 @@ Test::BDD::Cucumber::Model::Document - Model to represent a 
feature file, parsed
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Model/Line.pm 
b/lib/Test/BDD/Cucumber/Model/Line.pm
index cf3d549..4f94944 100644
--- a/lib/Test/BDD/Cucumber/Model/Line.pm
+++ b/lib/Test/BDD/Cucumber/Model/Line.pm
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::Model::Line;
-$Test::BDD::Cucumber::Model::Line::VERSION = '0.23';
+$Test::BDD::Cucumber::Model::Line::VERSION = '0.24';
 use Moose;
 
 =head1 NAME
@@ -8,7 +8,7 @@ Test::BDD::Cucumber::Model::Line - Model to represent a line in 
a feature file
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Model/Result.pm 
b/lib/Test/BDD/Cucumber/Model/Result.pm
index 1eafb4c..cb54204 100644
--- a/lib/Test/BDD/Cucumber/Model/Result.pm
+++ b/lib/Test/BDD/Cucumber/Model/Result.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Model::Result;
-$Test::BDD::Cucumber::Model::Result::VERSION = '0.23';
+$Test::BDD::Cucumber::Model::Result::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Model::Result - Encapsulates a result state
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Model/Scenario.pm 
b/lib/Test/BDD/Cucumber/Model/Scenario.pm
index d54a79f..8e6d196 100644
--- a/lib/Test/BDD/Cucumber/Model/Scenario.pm
+++ b/lib/Test/BDD/Cucumber/Model/Scenario.pm
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::Model::Scenario;
-$Test::BDD::Cucumber::Model::Scenario::VERSION = '0.23';
+$Test::BDD::Cucumber::Model::Scenario::VERSION = '0.24';
 use Moose;
 
 =head1 NAME
@@ -8,7 +8,7 @@ Test::BDD::Cucumber::Model::Scenario - Model to represent a 
scenario
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Model/Step.pm 
b/lib/Test/BDD/Cucumber/Model/Step.pm
index 9603efe..a195cc5 100644
--- a/lib/Test/BDD/Cucumber/Model/Step.pm
+++ b/lib/Test/BDD/Cucumber/Model/Step.pm
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::Model::Step;
-$Test::BDD::Cucumber::Model::Step::VERSION = '0.23';
+$Test::BDD::Cucumber::Model::Step::VERSION = '0.24';
 use Moose;
 
 =head1 NAME
@@ -8,7 +8,7 @@ Test::BDD::Cucumber::Model::Step - Model to represent a step in 
a scenario
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Model/TagSpec.pm 
b/lib/Test/BDD/Cucumber/Model/TagSpec.pm
index e9cfbda..bdc5e08 100644
--- a/lib/Test/BDD/Cucumber/Model/TagSpec.pm
+++ b/lib/Test/BDD/Cucumber/Model/TagSpec.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Model::TagSpec;
-$Test::BDD::Cucumber::Model::TagSpec::VERSION = '0.23';
+$Test::BDD::Cucumber::Model::TagSpec::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Model::TagSpec - Encapsulates tag selectors
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/Parser.pm b/lib/Test/BDD/Cucumber/Parser.pm
index a07fc94..5db3e0e 100644
--- a/lib/Test/BDD/Cucumber/Parser.pm
+++ b/lib/Test/BDD/Cucumber/Parser.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::Parser;
-$Test::BDD::Cucumber::Parser::VERSION = '0.23';
+$Test::BDD::Cucumber::Parser::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::Parser - Parse Feature files
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
@@ -32,7 +32,6 @@ L<Test::BDD::Cucumber::Model::Feature> object on success.
 use strict;
 use warnings;
 
-use Ouch;
 use File::Slurp;
 
 use Test::BDD::Cucumber::Model::Document;
@@ -41,10 +40,13 @@ use Test::BDD::Cucumber::Model::Scenario;
 use Test::BDD::Cucumber::Model::Step;
 use Test::BDD::Cucumber::Model::TagSpec;
 use Test::BDD::Cucumber::I18n qw(langdef);
+use Test::BDD::Cucumber::Errors qw/parse_error_from_line/;
 
 # https://github.com/cucumber/cucumber/wiki/Multiline-Step-Arguments
 # https://github.com/cucumber/cucumber/wiki/Scenario-outlines
 
+
+
 sub parse_string {
        my ( $class, $string, $tag_scheme ) = @_;
 
@@ -63,13 +65,13 @@ sub parse_file   {
 
 sub _construct {
        my ( $class, $document, $tag_scheme ) = @_;
-       
+
        my $feature = Test::BDD::Cucumber::Model::Feature->new({ document => 
$document });
         my @lines = $class->_remove_next_blanks( @{ $document->lines } );
 
        $feature->language($class->_extract_language(\@lines));
 
-       my $self = { langdef => 
+       my $self = { langdef =>
                     langdef($feature->language) };
         bless $self, $class;
 
@@ -124,7 +126,7 @@ sub _extract_feature_name {
                        push( @feature_tags, @tags );
 
                } else {
-                       ouch 'parse_error', "Malformed feature line", $line;
+                       die parse_error_from_line( "Malformed feature line", 
$line );
                }
        }
 
@@ -163,8 +165,8 @@ sub _extract_scenarios {
 
             # Only one background section, and it must be the first
             if ( $scenarios++ && $type =~ m/^($langdef->{background})/ ) {
-                ouch 'parse_error', "Background not allowed after scenarios",
-                  $line;
+                die parse_error_from_line( "Background not allowed after 
scenarios",
+                  $line);
             }
 
             # Create the scenario
@@ -193,7 +195,7 @@ sub _extract_scenarios {
             push( @scenario_tags, @tags );
 
         } else {
-            ouch 'parse_error', "Malformed scenario line", $line;
+            die parse_error_from_line( "Malformed scenario line", $line );
         }
     }
 
@@ -245,8 +247,7 @@ 
m/^((?:$langdef->{given})|(?:$langdef->{and})|(?:$langdef->{when})|(?:$langdef->
             return $self->_extract_table( 6, $scenario,
                 $self->_remove_next_blanks(@lines) );
         } else {
-            warn $line->content;
-            ouch 'parse_error', "Malformed step line", $line;
+            die parse_error_from_line( "Malformed step line", $line );
         }
     }
 
@@ -313,7 +314,7 @@ sub _extract_table {
                }
 
                if ( @columns ) {
-                       ouch 'parse_error', "Inconsistent number of rows in 
table", $line
+                       die parse_error_from_line( "Inconsistent number of rows 
in table", $line )
                                unless @rows == @columns;
             $target->columns( [ @columns ] ) if $target->can('columns');
                        my $i = 0;
@@ -336,12 +337,6 @@ sub _pipe_array {
 
 1;
 
-=head1 ERROR HANDLING
-
-L<Test::BDD::Cucumber> uses L<Ouch> for exception handling. Errors originating 
in this
-class tend to have a code of C<parse_error> and a 
L<Test::BDD::Cucumber::Model::Line>
-object for data.
-
 =head1 AUTHOR
 
 Peter Sergeant C<p...@clueball.com>
diff --git a/lib/Test/BDD/Cucumber/StepContext.pm 
b/lib/Test/BDD/Cucumber/StepContext.pm
index bfe42b7..5ec20f0 100644
--- a/lib/Test/BDD/Cucumber/StepContext.pm
+++ b/lib/Test/BDD/Cucumber/StepContext.pm
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::StepContext;
-$Test::BDD::Cucumber::StepContext::VERSION = '0.23';
+$Test::BDD::Cucumber::StepContext::VERSION = '0.24';
 use Moose;
 use List::Util qw( first );
 
@@ -9,7 +9,7 @@ Test::BDD::Cucumber::StepContext - Data made available to step 
definitions
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/lib/Test/BDD/Cucumber/StepFile.pm 
b/lib/Test/BDD/Cucumber/StepFile.pm
index d796e91..5106d37 100755
--- a/lib/Test/BDD/Cucumber/StepFile.pm
+++ b/lib/Test/BDD/Cucumber/StepFile.pm
@@ -1,12 +1,12 @@
 package Test::BDD::Cucumber::StepFile;
-$Test::BDD::Cucumber::StepFile::VERSION = '0.23';
+$Test::BDD::Cucumber::StepFile::VERSION = '0.24';
 =head1 NAME
 
 Test::BDD::Cucumber::StepFile - Functions for creating and loading Step 
Definitions
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =cut
 
diff --git a/lib/Test/BDD/Cucumber/Util.pm b/lib/Test/BDD/Cucumber/Util.pm
index 3b1f4fa..ae8fe2a 100644
--- a/lib/Test/BDD/Cucumber/Util.pm
+++ b/lib/Test/BDD/Cucumber/Util.pm
@@ -1,5 +1,5 @@
 package Test::BDD::Cucumber::Util;
-$Test::BDD::Cucumber::Util::VERSION = '0.23';
+$Test::BDD::Cucumber::Util::VERSION = '0.24';
 use strict;
 use warnings;
 
@@ -9,7 +9,7 @@ Test::BDD::Cucumber::Util - Some functions used throughout the 
code
 
 =head1 VERSION
 
-version 0.23
+version 0.24
 
 =head1 DESCRIPTION
 
diff --git a/t/400_app_pherkin_harnesses.t b/t/400_app_pherkin_harnesses.t
new file mode 100644
index 0000000..217209e
--- /dev/null
+++ b/t/400_app_pherkin_harnesses.t
@@ -0,0 +1,26 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+my @known_harnesses = (
+    "Data", # Short form
+    "Test::BDD::Cucumber::Harness::TermColor", # Long form
+    "Test::BDD::Cucumber::Harness::TestBuilder"
+);
+
+use_ok("App::pherkin");
+
+for my $harness ( @known_harnesses ) {
+    my $app = App::pherkin->new();
+    my $object = $app->_load_harness( $harness );
+    isa_ok(
+        $object,
+        "Test::BDD::Cucumber::Harness",
+        "Loaded harness by name: [$harness] -> [" . (ref $object) . "]"
+    );
+}
+
+done_testing();
\ No newline at end of file
diff --git a/t/500_error_formatter.t b/t/500_error_formatter.t
new file mode 100644
index 0000000..8dd7dbc
--- /dev/null
+++ b/t/500_error_formatter.t
@@ -0,0 +1,135 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::BDD::Cucumber::Parser;
+use Test::BDD::Cucumber::Errors qw/parse_error_from_line/;
+
+my $feature = Test::BDD::Cucumber::Parser->parse_string( join '', (<DATA>) );
+
+# Test different offsets
+my @tests = (
+    [ 0 =>
+        1,
+        "# Somehow I don't see this replacing the other tests this module 
has...",
+        "Feature: Simple tests of Digest.pm",
+        "  As a developer planning to use Digest.pm",
+        "",
+        "  Background:",
+    ],
+    [ 1 =>
+        1,
+        "# Somehow I don't see this replacing the other tests this module 
has...",
+        "Feature: Simple tests of Digest.pm",
+        "  As a developer planning to use Digest.pm",
+        "",
+        "  Background:",
+    ],
+    [ 2 =>
+        1,
+        "# Somehow I don't see this replacing the other tests this module 
has...",
+        "Feature: Simple tests of Digest.pm",
+        "  As a developer planning to use Digest.pm",
+        "",
+        "  Background:",
+    ],
+    [ 4 =>
+        2,
+        "Feature: Simple tests of Digest.pm",
+        "  As a developer planning to use Digest.pm",
+        "",
+        "  Background:",
+        '    Given a usable "Digest" class',
+    ],
+    [ 10 =>
+        8,
+        '  Scenario: Check MD5',
+        '    Given a Digest MD5 object',
+        '    When I\'ve added "foo bar baz" to the object',
+        '    And I\'ve added "bat ban shan" to the object',
+        '    Then the hex output is "bcb56b3dd4674d5d7459c95e4c8a41d5"',
+    ],
+    [ 12 =>
+        9,
+        '    Given a Digest MD5 object',
+        '    When I\'ve added "foo bar baz" to the object',
+        '    And I\'ve added "bat ban shan" to the object',
+        '    Then the hex output is "bcb56b3dd4674d5d7459c95e4c8a41d5"',
+        '    Then the base64 output is "1B2M2Y8AsgTpgAmY7PhCfg"',
+    ],
+    [ 13 =>
+        9,
+        '    Given a Digest MD5 object',
+        '    When I\'ve added "foo bar baz" to the object',
+        '    And I\'ve added "bat ban shan" to the object',
+        '    Then the hex output is "bcb56b3dd4674d5d7459c95e4c8a41d5"',
+        '    Then the base64 output is "1B2M2Y8AsgTpgAmY7PhCfg"',
+    ],
+    [ 14 =>
+        9,
+        '    Given a Digest MD5 object',
+        '    When I\'ve added "foo bar baz" to the object',
+        '    And I\'ve added "bat ban shan" to the object',
+        '    Then the hex output is "bcb56b3dd4674d5d7459c95e4c8a41d5"',
+        '    Then the base64 output is "1B2M2Y8AsgTpgAmY7PhCfg"',
+    ],
+);
+
+for ( @tests ) {
+    my ( $offset, $expected_offset, @lines ) = @$_;
+    is_deeply(
+        [
+            Test::BDD::Cucumber::Errors::_get_context_range(
+                $feature->document, $offset )
+        ],
+        [
+            $expected_offset,
+            @lines
+        ],
+        "Offset $offset works"
+    )
+}
+
+my $make_error = parse_error_from_line(
+    "Foo bar baz", $feature->document->lines->[1]
+);
+
+is( $make_error,
+"-- Parse Error --
+
+ Foo bar baz
+  at [(no filename)] line 2
+  thrown by: [t/500_error_formatter.t] line 95
+
+-- [(no filename)] --
+
+  1|    # Somehow I don't see this replacing the other tests this module has...
+  2*    Feature: Simple tests of Digest.pm
+  3|      As a developer planning to use Digest.pm
+  4|    "."
+  5|      Background:
+
+---------------------
+",
+    "Error example matches"
+);
+
+
+done_testing();
+
+__DATA__
+# Somehow I don't see this replacing the other tests this module has...
+Feature: Simple tests of Digest.pm
+  As a developer planning to use Digest.pm
+
+  Background:
+    Given a usable "Digest" class
+
+  Scenario: Check MD5
+    Given a Digest MD5 object
+    When I've added "foo bar baz" to the object
+    And I've added "bat ban shan" to the object
+    Then the hex output is "bcb56b3dd4674d5d7459c95e4c8a41d5"
+    Then the base64 output is "1B2M2Y8AsgTpgAmY7PhCfg"
\ No newline at end of file
diff --git a/t/release-pod-coverage.t b/t/release-pod-coverage.t
deleted file mode 100644
index 18a8274..0000000
--- a/t/release-pod-coverage.t
+++ /dev/null
@@ -1,15 +0,0 @@
-#!perl
-
-BEGIN {
-  unless ($ENV{RELEASE_TESTING}) {
-    require Test::More;
-    Test::More::plan(skip_all => 'these tests are for release candidate 
testing');
-  }
-}
-
-# This file was automatically generated by 
Dist::Zilla::Plugin::PodCoverageTests.
-
-use Test::Pod::Coverage 1.08;
-use Pod::Coverage::TrustPod;
-
-all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libtest-bdd-cucumber-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to