jeremy.marzhillstudios.com/content/Moose-Role-Testing-2007-9-22.md

11 lines
654 B
Markdown
Raw Permalink Normal View History

2020-04-12 10:56:18 -04:00
+++
title = "Moose::Role Testing"
2020-04-12 15:59:04 -04:00
date = 2007-09-22T05:28:23Z
2020-04-12 10:56:18 -04:00
in_search_index = true
[taxonomies]
tags = [
"Site-News",
]
+++
2020-04-12 09:34:11 -04:00
Currently there is no simple way to test Moose::Roles. Since they defer things like attribute adding and method wrapping you have to create a dummy class that uses them to test what they do. Usually this is through creating a package inline in the test module that does what you need or don't need based on what your testing. Therefore I'm considering either adding Role support to Test::Moose or creating a Test::Moose::MockObject module to make this easier. Still trying to decide which way to go. Maybe I'll go both ways :-)