package Eve::RegistryStub;

use strict;
use warnings;

no warnings qw(redefine);

use Test::MockObject::Extends;

use Eve::Registry;

=head1 NAME

B<Eve::RegistryStub> - a helper class that replaces the registry with
a mock object.


    package SomeTestCase;

    use Eve::RegistryStub;
    use Eve::Registry;

    my $already_mocked_registry = Eve::Registry->new(
        # some literals declarations);

    my $service = $registry->get_service();


B<Eve::RegistryStub> is the mock version of a B<Eve::Registry> class
that contains all services and automatically replaces some input
parameter with bogus default values..

=head1 METHODS

=head2 B<main()>


sub main {
    my $init = \&Eve::Registry::init;

    *Eve::Registry::new = sub {
        my $self = &Eve::Class::new(@_);

        return Test::MockObject::Extends->new($self);

    *Eve::Registry::init = sub {
        my $self = shift;

            base_uri_string => '',
            email_from_string => 'Someone <>',
            session_storage_path => File::Spec->catdir(
                File::Spec->tmpdir(), 'test_session_storage'),
            session_expiration_interval => 3600,


=head1 SEE ALSO

=over 4

=item L<Eve::Test>

=item L<Test::Class>



Copyright 2010-2013 Sergey Konoplev, Igor Zinovyev.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See for more information.

=head1 AUTHOR

=over 4

=item L<Sergey Konoplev|>

=item L<Igor Zinovyev|>