On Feb 4, 2010, at 6:13 AM, Mark Jaroski wrote:
> OK, so that's done. I also sketched out that idea that I mentioned about
> debugging. Have a look here:
>
> http://github.com/MarkJaroski/bricolage/commit/6004916c9a187778568432ba8514317d9fe78238
The commit message says, "Switched to transactional approch to setup and teardown." But it sure looks more like you just disable all database access. That's not desirable. The database access must be tested, too. Also, you need to delete the cached mocks in a teardown method, otherwise they'll last for all tests after that one runs (the test object is a singleton).
> and here:
>
> http://github.com/MarkJaroski/bricolage/commit/600fdc9f04480083c5abfa0555e60a68f19d88cc
Yuck. I'm against having test-specific code in modules. Also, why did you remove some of the calls to test functions?
- ok( my $burner = Bric::Util::Burner->new, "Get burner" );
- ok( $burner->deploy($tmpl[0]), "Deploy autohandler template" );
- ok( $burner->deploy($tmpl[1]), "Deploy story template" );
+ my $burner = Bric::Util::Burner->new;
+ $burner->deploy($tmpl[0]);
+ $burner->deploy($tmpl[1]);
Those methods return true values. Please put them back.
Best,
David
> OK, so that's done. I also sketched out that idea that I mentioned about
> debugging. Have a look here:
>
> http://github.com/MarkJaroski/bricolage/commit/6004916c9a187778568432ba8514317d9fe78238
The commit message says, "Switched to transactional approch to setup and teardown." But it sure looks more like you just disable all database access. That's not desirable. The database access must be tested, too. Also, you need to delete the cached mocks in a teardown method, otherwise they'll last for all tests after that one runs (the test object is a singleton).
> and here:
>
> http://github.com/MarkJaroski/bricolage/commit/600fdc9f04480083c5abfa0555e60a68f19d88cc
Yuck. I'm against having test-specific code in modules. Also, why did you remove some of the calls to test functions?
- ok( my $burner = Bric::Util::Burner->new, "Get burner" );
- ok( $burner->deploy($tmpl[0]), "Deploy autohandler template" );
- ok( $burner->deploy($tmpl[1]), "Deploy story template" );
+ my $burner = Bric::Util::Burner->new;
+ $burner->deploy($tmpl[0]);
+ $burner->deploy($tmpl[1]);
Those methods return true values. Please put them back.
Best,
David