App-SimpleScan

 view release on metacpan or  search on metacpan

lib/App/SimpleScan/TestSpec.pm  view on Meta::CPAN

package App::SimpleScan::TestSpec;
use strict;
use warnings;
use Regexp::Common;

use base qw(Class::Accessor::Fast);
our $VERSION = 0.24;

__PACKAGE__->mk_accessors(qw(raw uri regex delim kind comment metaquote syntax_error flags test_count));

my $app;     # Will store a reference to the parent App::Simplescan

my %test_type = 
  (
    'Y' => <<"EOS",
page_like "<uri>",
          qr<delim><regex><delim><flags>,
          qq(<comment> [<uri>] [<qmregex> should match]);
EOS
    'N' => <<"EOS",
page_unlike "<uri>",
            qr<delim><regex><delim><flags>,
            qq(<comment> [<uri>] [<qmregex> shouldn't match]);
EOS
    'TY' => <<"EOS",
TODO: {
  local \$Test::WWW::Simple::TODO = "Doesn't match now but should later";
  page_like "<uri>",
            qr<delim><regex><delim><flags>,
            qq(<comment> [<uri>] [<qmregex> should match]);
}
EOS
    'TN' => <<"EOS",
TODO: {
  local \$Test::WWW::Simple::TODO = "Matches now but shouldn't later";
  page_unlike "<uri>",
              qr<delim><regex><delim><flags>,
              qq(<comment> [<uri>] [<qmregex> shouldn't match]);
}
EOS
    'SY' => <<"EOS",
SKIP: {
  skip 'Deliberately skipping test that should match', 1; 
  page_like "<uri>",
            qr<delim><regex><delim><flags>,
            qq(<comment> [<uri>] [<qmregex> should match]);
}
EOS
    'SN' => <<"EOS",
SKIP: {
  skip "Deliberately skipping test that shouldn't match", 1; 
  page_unlike "<uri>",
              qr<delim><regex><delim><flags>,
              qq(<comment> [<uri>] [<qmregex> shouldn't match]);
}
EOS
  );

sub app {
  my ($class_or_object, $appref) = @_;
  if (defined $appref) {
    $app = $appref;
  }
  return $app;
}

sub new {



( run in 0.452 second using v1.01-cache-2.11-cpan-e1769b4cff6 )