houseabsolute / HTML-Mason

High-performance, dynamic web site authoring system
https://metacpan.org/release/HTML-Mason/
Other
9 stars 18 forks source link

Less of an issue... #30

Closed davehodg closed 4 years ago

davehodg commented 4 years ago

Sorry we seem to have been quiet for a few months.

I have a bunch of live MAson code which has no tests. I'm looking for examples of Mason tests, but the only tests I can find have add_test with the component inline. I can't see how to add a test to a file.

Halp?

autarch commented 4 years ago

Sorry for the slow response. Honestly, I haven't used Mason myself in ages. I just fix critical bugs in it these days.

You should be able to instantiate an Interp object with a Resolver and have it load components off the filesystem for tests.

davehodg commented 4 years ago

OK, I know those words, just not the order they've been used in. Got any examples of this on GitHub? Know anyone with public code doing it I can cargo-cult?

Is HTML::Mason::Tests not worth looking at?

autarch commented 4 years ago

OK, I know those words, just not the order they've been used in. Got any examples of this on GitHub? Know anyone with public code doing it I can cargo-cult?

Is HTML::Mason::Tests not worth looking at?

Look at whatever code executes your Mason templates. That will construct the same objects you'd want to use in your tests.