Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup/Startup Methods Can't Be Overridden #48

Open
szabgab opened this issue Feb 23, 2021 · 0 comments
Open

Setup/Startup Methods Can't Be Overridden #48

szabgab opened this issue Feb 23, 2021 · 0 comments

Comments

@szabgab
Copy link
Collaborator

szabgab commented Feb 23, 2021

Startup/setup methods in base classes that are overridden by subclasses
are still called. For example:

package PigTest;

use base 'Test::Class';

sub startup : Test(startup) 
{ 
  $self->{fixture} = PigService->create($argz)
}

sub eats : Test { }

package PorkyPigTest;

use base 'PigTest';

sub startup : Test(startup) 
{ 
  $self->{fixture} = PorkyPigService->create($argz)
}

sub talks : Test  { }

PigService will be called when running the PorkyPigTest.

Of course this is simple to fix, but it's surprising and unintuitive.

Original: https://rt.cpan.org/Ticket/Display.html?id=72896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant