こんにちは、カワ(・∀・)イイ!!アイコンで有名なnekokakだよ。 今日はカワ(・∀・)イイ!!僕がつくったTest::Attribute::AutoLevelという イカしたモジュールを紹介してみたいと思うんだ。 僕はテストを書く時にテスト用の便利関数を定義することがよくあるんだ。 そのテスト関数の中でTest::Moreのテスト関数を実行するんだけど、 そこでテストがコケたときに表示されるエラーメッセージがおかしなことになるんだ。 例えば use strict; use warnings; use Test::More; sub test_cute_icon { my $icon = shift; is $icon->{state}, 'cute'; } { package My::Icon; sub new { my ($class, $opts) = @_; bless $op
![use Test::Attribute::AutoLevel - Articles Advent Calendar 2011 Test](https://cdn-ak-scissors.b.st-hatena.com/image/square/8780010aa599439ef81fb58220e6fa27d337b61c/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fkfly8%2Fimage%2Fupload%2Fl_text%3ANotoSansJP-Black.otf_50_bold%3Ause%2520Test%253A%253AAttribute%253A%253AAutoLevel%2Cco_rgb%3A000000%2Cw_900%2Cc_fit%2F%2Fv1601626948%2Fog-perl-users-jp.png)