Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-13 Thread David Cantrell
On Mon, Nov 11, 2013 at 02:29:01PM -0500, Rob Kinyon wrote: This makes for poor testability. Otherwise, when you have a schema change, you either: 1. Force everyone sharing the same developer instance to immediately have to deal with your schema changes Having devs share a database will

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-11 Thread Adam Witney
Hi Rob, Thanks again for your help. The problem I am having is working out how to put it all together. The documentation often contains snippets of code, but not a full (short) script, which would help when trying to see how it all works together. So with the ::Sims module, does each test

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-11 Thread Rob Kinyon
Adam - Each test sets up the database exactly as it wants. In general, I do something like: $schema-deploy({ add_drop_table = 1, }); $schema-load_sims( $spec ); in each one of my test scripts that use the Sims. Presumably, I'm working in some in-memory SQLite database or a scratch MySQL

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-11 Thread Adam Witney
Thanks again for your email Rob, Just to clarify from looking at the docs again, I would have to edit all my Result classes to add sim information, right? Wouldn't this break every time I refreshed the schema from the database (./script/xxx_create.pl model DB ... etc)? Thanks again adam

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-11 Thread Rob Kinyon
On Mon, Nov 11, 2013 at 10:48 AM, Adam Witney awit...@sgul.ac.uk wrote: Thanks again for your email Rob, Just to clarify from looking at the docs again, I would have to edit all my Result classes to add sim information, right? Wouldn't this break every time I refreshed the schema from the

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-11 Thread Adam Witney
On 11 Nov 2013, at 16:05, Rob Kinyon rob.kin...@gmail.com wrote: On Mon, Nov 11, 2013 at 10:48 AM, Adam Witney awit...@sgul.ac.uk wrote: Thanks again for your email Rob, Just to clarify from looking at the docs again, I would have to edit all my Result classes to add sim information,

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-11 Thread Rob Kinyon
On Mon, Nov 11, 2013 at 2:22 PM, Adam Witney awit...@sgul.ac.uk wrote: On 11 Nov 2013, at 16:05, Rob Kinyon rob.kin...@gmail.com wrote: On Mon, Nov 11, 2013 at 10:48 AM, Adam Witney awit...@sgul.ac.uk wrote: Thanks again for your email Rob, Just to clarify from looking at the docs again,

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-11 Thread Adam Witney
That's an interesting point of view. I tend to make my database changes directly with SQL and when I am ready regenerate the schema files from there. This makes for poor testability. Otherwise, when you have a schema change, you either: 1. Force everyone sharing the same developer

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-05 Thread Adam Witney
Thanks Rob, although I'm not sure how that makes it any easier, do you have an example script? Thanks Adam On 4. 11. 2013 15:53, Rob Kinyon wrote: This doesn't answer your question directly, but consider using DBIx::Class::Sims instead for generating test data. On Mon, Nov 4, 2013 at

Re: [Dbix-class] Dumping fixtures and loading in test script

2013-11-05 Thread Rob Kinyon
Instead of dumping data from a reference database, ::Sims allows you to generate reasonable-looking data directly. This way, if your schema changes, your fixtures aren't out-of-date anymore. Also, each test now describes exactly what it needs from the database without having to depend on a large