Masatoshi Mizuno > Egg-Release-3.14 > Egg::Helper::Util::VirtualProject

Download:
Egg-Release-3.14.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 3.00   Source  

NAME ^

Egg::Helper::Util::VirtualProject - Virtual project for package test.

SYNOPSIS ^

  use Test::More tests=> 10;
  use Egg::Helper;
  
  my $e= Egg::Helper->run('vtest');

DESCRIPTION ^

It is a helper who offers the virtual project environment to use it in the package test of the module.

The object of a virtual project is passed and 'Vtest' is passed to the 'run' method of obtaining Egg::Helper.

  my $e= Egg::Helper->run('vtest');

And, it is treated since the first argument as a configuration of the project.

The name of a virtual project is usual 'Vtest'. 'project_name' is set to the configuration and it is revokable.

  my $e= Egg::Helper->run( vtest => {
    project_name => 'MyProject',
    } );

The plug-in to want to load into a virtual project sets 'plugins' to the configuration.

  my $e= Egg::Helper->run( vtest => {
    plugins => [qw/ -Debug Encode Filter /],
    });

* The flag is specified in 'plugins'.

It is executed before the object is generated when the code reference is set in 'start_code'.

  my $e= Egg::Helper->run( vtest => {
    start_code => sub {
      ....................
      .........
      },
    });

The method that wants to be generated with 'create_methods' can be set.

  my $e= Egg::Helper->run( vtest => {
    create_methods => {
      hoo => sub {
           my($e)= @_;
           ........
        },
      boo => sub {
           my($e)= @_;
           ........
        },
      },
    });

The root directory of a virtual project is made from the project name in the place obtained by 'helper_tempdir' of Egg::Helper. Moreover, the work directory moves to this root directory at the same time as generating the object.

Please set it in the configuration when 'dispatch_map' is necessary. You may separately generate the Dispatch module of course and read.

Please intitule an individual project in 'project_name' when two or more virtual projects are necessary. When two or more virtual projects are generated with the same name, the inconvenience of the redefine of the method etc. is generated.

SEE ALSO ^

Egg::Release, Egg::Helper, Class::Data::Inheritable,

AUTHOR ^

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: