Modulino-Demo

 view release on metacpan or  search on metacpan

lib/Modulino/Demo.pm  view on Meta::CPAN

		Test::More::fail();
		}
	}

=back

=head2 Testing

=over 4

=item test

Run all of the subroutines that start with C<_test_>. Each subroutine
is wrapped in a C<Test::More> subtest.

=cut

sub test {
	say "Running as test";

	my( $class ) = @_;
	my @tests = $class->_get_tests;

	require Test::More;

	foreach my $test ( @tests ) {
		Test::More::subtest( $test => sub {
			my $rc = eval { $class->$test(); 1 };
			Test::More::diag( $@ ) unless defined $rc;
			} );
		}
	}

sub _get_tests {
	my( $class ) = @_;
	no strict 'refs';
	my $stub = $class . '::';
	my @tests =
		grep { defined &{"$stub$_"}    }
		grep { 0 == index $_, '_test_' }
		keys %{ "$stub" };

	say "Tests are @tests";
	@tests;
	}

=back

=head2 Reading the docs

=over 4

=item doc

=cut

sub doc {
	say "Running as docs";

	my $data = do {
		local( @ARGV, $/ ) = __FILE__;
		<>;
		};

	my $package = __PACKAGE__;
	$data =~ s/__PACKAGE__/$package/;

	say $data;
	}

sub _test_doc {
	require Test::More;
	require Test::Pod;
	require Test::Pod::Coverage;
	our $TODO;

	Test::Pod::pod_file_ok( __FILE__ );
	TODO: {
		local $TODO = "Pod::Coverage can't find the pod";
		Test::Pod::Coverage::pod_coverage_ok( __PACKAGE__ );
		}
	}

=back

=head1 TO DO


=head1 SEE ALSO


=head1 SOURCE AVAILABILITY

This source is in Github:

	https://github.com/briandfoy/modulino-demo/

=head1 AUTHOR

brian d foy, C<< <briandfoy@pobox.com> >>

=head1 COPYRIGHT AND LICENSE

Copyright © 2012-2025, brian d foy <briandfoy@pobox.com>. All rights reserved.

You may redistribute this under the terms as the Artistic License 2.0.

=cut

1;



( run in 0.974 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )