Shlomi Fish avatar Shlomi Fish committed 7d575d6

Fix more.

Comments (0)

Files changed (2)

XML-GrammarBase/lib/XML/GrammarBase/Role/DataDir.pm

 
 has 'module_base' => (isa => sub {
         my ($dist_name) = @_;
-        print "<<DistName == $dist_name>>\n";
         if (not (
                 (ref($dist_name) eq '')
                 &&

XML-GrammarBase/t/data_dir.t

 #!/usr/bin/perl
 
+package MyClass::WithDataDir;
+
+use MooX 'late';
+
+with ('XML::GrammarBase::Role::DataDir');
+
+has '+module_base' => (default => 'XML::Grammar::MyGrammar');
+
+package main;
+
 use strict;
 use warnings;
 
 use Test::More tests => 1;
 
-package MyClass::WithDataDir;
+{
+    my $obj;
+    eval
+    {
+        # TEST
+        $obj = MyClass::WithDataDir->new;
+        my $test = $obj->module_base;
+    };
 
-use Test::More;
+    my $Err = $@;
 
-use MooX 'late';
-
-BEGIN
-{
-with ('XML::GrammarBase::Role::DataDir');
-};
-
-eval {
-
-has '+module_base' => (default => 'XML::Grammar::MyGrammar');
-
-};
-
-# TEST
-ok ($@, "Validation error for colon delimited values.");
+    # TEST
+    like ($Err, qr/isa check for "module_base" failed/,
+        "Accessing module_base threw an exception",
+    );
+}
 
 =head1 COPYRIGHT & LICENSE
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.