Last active
August 29, 2015 14:11
-
-
Save Songmu/d4d6608a47103726aa10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Hoge; | |
use strict; | |
use warnings; | |
use utf8; | |
use MyCon; | |
sub hage { | |
HOGE; | |
} | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyCon; | |
use strict; | |
use warnings; | |
use utf8; | |
use Const::Common ( | |
HOGE => 'はげ', | |
); | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use utf8; | |
use Test::More; | |
use Hoge; | |
use Test::Mock::Guard; | |
subtest 'orig' => sub { | |
is Hoge::hage, 'はげ'; | |
}; | |
subtest 'hagemaru' => sub { | |
my $g = mock_guard Hoge => { | |
hage => 'ハゲマル', | |
}; | |
is Hoge::hage, 'ハゲマル'; | |
}; | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment