Phlip wrote:
> Derek Williams wrote:
>
>
>> You can bring those issues up with him then? It is a simple and stale
>> fixture framework. Even so, I'm fairly certain many of your issues would
>> be solved if you used it with datamapper.
>>
>
> I was rather careful to not discuss the sequel-specific issues. I suspect
> 'given' would have the same issues.
>
> At my day job, with 1,700 test cases in just one project, we are very
> sensitive
> to the quality of our fixtures and their database hooks. Doing things The
> Merb
> Way would slow down both our programming, and our test runs
I'm sorry? No, doing things the "Merb Way" would NOT slow you down. You
are doing things wrong. Plain and simple. You are refusing to use the
correct tools for the job and then complaining about it.
merb-fixtures is not merb. It is not part of merb. It created to be used
in merb by someone that was nice enough to publicly host their code on
github so you could use it if you want.
Sequel does not work how you expect, so either learn to use it, or don't
use it.
You say you are very sensitive to the quality of your fixtures... then
please stop using sequel with merb-fixtures. Really. Stop it.
You said it is just a blog. It is simple. I understand that. So I am
giving you simple answers to try and help you learn what it is you
expect to get out of all this. The advice I have given you so far is not
the same I would give to someone working on a major project like the one
at your job.
For my current project, I use dm-sweatshop. It takes care of all
associations and loading into the database, and generates random data to
my specifications. I use transactions as to not take a speed hit
deleting the records. If you want to be database agnostic, you could
even use the in memory datastore for your records and not have to worry
about the speed hit inserting the records. This is what my specs look like:
given "a photo exists" do
Photo.gen
end
describe "resource(:photos)" do
describe "GET" do
describe "given no photos" do
subject { request_photo(:photos) }
it { should be_successful }
it { should have_xpath("/photos") }
it { should_not have_xpath("/photos/photo") }
end
describe "given one photo", :given => "a photo exists" do
subject { request_photo(:photos) }
it { should be_successful }
it { should have_xpath("/photos/photo") }
.... and so on
My fixtures.rb:
Photo.fixture {{
:title => /[:sentence:]/.generate,
:description => /[:paragraph:]/.generate,
:shutter_speed => ['5', '1', '1/30', '1/60', '1/250', '1/1000'].pick,
:aperature => [1.4, 1.8, 2, 2.8, 5.6, 8, 11, 16].pick,
:iso_speed => [100, 200, 400, 800, 1600, 3200].pick,
:focal_length => [18, 30, 50, 85, 105, 200].pick,
:versions => (2..5).of {Version.make(:preferred => true)}
.... and so on
This is my "Merb Way". Other people have their own "Merb Way". Nobody is
trying to force their way on you, you have the flexibility to do it how
you want to. That is the main benefit to using merb over rails, like you
stated before. So please, you have a testing process that works for you
at your job, use that if you are more familiar and can work faster with it.
Derek
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---