view の macro の test
もちゃんとするか〜みたいな時で、xslate とかだと
Text::Xslate->new( module => ["MyApp::View::Function"] );
みたいな感じで渡せるので
MyApp::View::Function に書いてある関数をそれぞれテストして、
Text::MicroTemplate::Extended とかだと coderef を渡すので
$mf->{macro}->{...}->();
みたいな感じ ?
rails の helper だと
describe HogeHelper do describe "string concat" do it "concats two strings with spaces" do helper.concat_strings("this","that").should == "this that" end end end
みたいな感じで template が最初から用意されてたりするので、さぼらないで view で使う関数の test も書いたほうが良さそう