Skip to content

Disable warning #3

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

Closed
wants to merge 1 commit into from
Closed

Disable warning #3

wants to merge 1 commit into from

Conversation

kablamo
Copy link

@kablamo kablamo commented May 15, 2014

Not totally sure if this the right thing to do. But it fixes my problem.

I was getting a warning running the following code.

package MyPackage;
use Moo;
around 'Test::Selenium::Remote::WebElement::has_args' => sub {...};

The warning was:

Name "MyPackage::Test::Selenium::Remote::WebElement::has_args" used only once: possible typo at local/lib/perl5/Class/Method/Modifiers.pm line 60.

@karenetheridge
Copy link
Member

Yeah, that's not really the best thing to do :)

try:

in t/lib/Foo.pm:

package Foo;

{
    package Test::Selenium::Remote::WebElement;
    use Class::Method::Modifiers;
    around has_args => sub { ... };
}

@kablamo
Copy link
Author

kablamo commented May 15, 2014

Huh. Crazy stuff. I surprised twice.

Once because it seems like its appending stuff to the Test::Selenium::Remote::WebElement instead of redefining the package. And twice because if I remove 'use Class::Method::Modifiers', it doesn't know about around even though Test::Selenium::Remote::WebElement is a Moo class.

But anyway that works. Thanks!

@kablamo kablamo closed this May 15, 2014
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

Successfully merging this pull request may close these issues.

2 participants