Alien-Build-Plugin-Probe-GnuWin32

 view release on metacpan or  search on metacpan

t/01_use.t  view on Meta::CPAN

done_testing;

sub require_ok ($)
{
  # special case of when I really do want require_ok.
  # I just want a test that checks that the modules
  # will compile okay.  I won't be trying to use them.
  my($mod) = @_;
  my $ctx = context();
  eval qq{ require $mod };
  my $error = $@;
  my $ok = !$error;
  $ctx->ok($ok, "require $mod");
  $ctx->diag("error: $error") if $error ne '';
  $ctx->release;
}

t/alien_build_plugin_probe_gnuwin32.t  view on Meta::CPAN

use Test2::V0;
use Alien::Build::Plugin::Probe::GnuWin32;
use Capture::Tiny qw( capture_merged );

subtest 'error no regex' => sub {

  my $plugin = eval { Alien::Build::Plugin::Probe::GnuWin32->new };
  my $error =  $@;
  isnt $error, '', 'throws exception with nothing';
  note "error = $error";

};

subtest 'using the typo' => sub {

  note scalar capture_merged { eval { Alien::Build::Plugin::Probe::GnuWin32->new( registery_key_regex => qr/ foo / ) } };
  is $@, '', 'no error';

};

subtest 'using the correctly spelled one' => sub {

  my $plugin = eval { Alien::Build::Plugin::Probe::GnuWin32->new( registry_key_regex => qr/ foo / )  };
  is $@, '', 'no error';

};

done_testing;



( run in 0.302 second using v1.01-cache-2.11-cpan-65fba6d93b7 )