[Dbix-class] Insert or Update (was ANNOUNCE: 0.08099_08)

Peter Corlett abuse at cabal.org.uk
Tue Apr 21 09:57:21 GMT 2009


On Mon, Apr 20, 2009 at 10:54:48AM -0700, David Ihnen wrote:
> Peter Corlett wrote:
[...]
>> It was more a prompt for somebody with better inside knowledge of  
>> DBIx::Class to take the idea and run with it or suggest a better  
>> implementation. No point writing tests for code that's not suitable to  
>> be used...
> I'd have to disagree. The thing you should write first and is most worth
> writing is the tests. That way you know your patch works - and regardless
> of what implementation is thrown at it can be interchangeably used to
> determine the suitability of it.

I should probably explain: the functionality started as a local hack inside
one of my applications. This was then fairly trivial to rip out and make
into a crufty patch against DBIC for further discussion. Boy, did it start
some discussion, albeit not quite what I was expecting.

I did run DBIC's and my application tests, which shook out some bugs in my
patch, but since my test is tightly-coupled to the application, I didn't
include it. There didn't seem to be any real point in writing a test for a
patch that wasn't actually intended for incorporation in DBIC as-is.

The rewrite as a component *does* have tests. It'll probably hit CPAN this
evening.




More information about the DBIx-Class mailing list