On Sep 20, 2008, at 8:53 PM, Ben Mabey wrote:
Ben Mabey wrote:
Scott Taylor wrote:
On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
Todd Tyree wrote:
Ok, here's what I've come up with on the spur of the moment
(goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Bas
Ben Mabey wrote:
> Scott Taylor wrote:
>
>> On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
>>
>>
>>> Todd Tyree wrote:
>>>
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Ba
Scott Taylor wrote:
>
> On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
>
>> Todd Tyree wrote:
>>> Ok, here's what I've come up with on the spur of the moment (goes in
>>> spec_helper.rb):
>>>
>>> config.after(:each) do
>>>result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
>>>whil
On Sep 20, 2008, at 7:18 PM, Ben Mabey wrote:
Todd Tyree wrote:
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
while table = result.fetch_row
# Or whatever y
Todd Tyree wrote:
> Ok, here's what I've come up with on the spur of the moment (goes in
> spec_helper.rb):
>
> config.after(:each) do
> result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
> while table = result.fetch_row
> # Or whatever you think is appropriate.
> n
"Mark Wilden" <[EMAIL PROTECTED]> writes:
> Just to be clear, these methods of truncating tables or remembering rows to
> delete are only useful in the presence of fixtures? Otherwise, the standard
> transactional support is sufficient and (probably) faster, right? (if for no
> other reason becaus
On Sep 20, 2008, at 8:08 AM, Todd Tyree wrote:
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
while table = result.fetch_row
# Or whatever you think is
Just to be clear, these methods of truncating tables or remembering rows to
delete are only useful in the presence of fixtures? Otherwise, the standard
transactional support is sufficient and (probably) faster, right? (if for no
other reason because it's all handled deep in the bowels of the db).
On 20 Sep 2008, at 11:33, Todd Tyree wrote:
We have a few lines of code in our features steps/env.rb that does
this
1. patch AR to stash each AR object created in an array
2. in an After do block, call destroy on each of those objects.
We can probably share if anyone would like to see thi
"Todd Tyree" <[EMAIL PROTECTED]> writes:
> Ok, here's what I've come up with on the spur of the moment (goes in
> spec_helper.rb):
>
> config.after(:each) do
> result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
> while table = result.fetch_row
> # Or whatever you think i
Ok, here's what I've come up with on the spur of the moment (goes in
spec_helper.rb):
config.after(:each) do
result = ActiveRecord::Base.connection.execute('SHOW TABLES;')
while table = result.fetch_row
# Or whatever you think is appropriate.
next if table.index('schema_migrat
On Sep 20, 2008, at 6:31 AM, Matt Wynne wrote:
On 20 Sep 2008, at 01:59, Scott Taylor wrote:
There's another approach though that I haven't tried yet. One of
the
guys I work with truncates all the tables in the db before every
example. He says this runs as fast or faster than transactio
> We have a few lines of code in our features steps/env.rb that does this
>
> 1. patch AR to stash each AR object created in an array
> 2. in an After do block, call destroy on each of those objects.
>
> We can probably share if anyone would like to see this.
>
>
Please!
Best,
Todd
___
On 20 Sep 2008, at 01:59, Scott Taylor wrote:
There's another approach though that I haven't tried yet. One of the
guys I work with truncates all the tables in the db before every
example. He says this runs as fast or faster than transactional
fixtures, and has the added benefit of NOT being
There's another approach though that I haven't tried yet. One of the
guys I work with truncates all the tables in the db before every
example. He says this runs as fast or faster than transactional
fixtures, and has the added benefit of NOT being in a transaction,
which
means that if he actua
On Fri, Sep 19, 2008 at 5:34 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> No, that is not correct. Here's how transactional fixtures work:
>
> 1. Before all specs run, load the fixtures into the database
> 2. Start a transaction. Run the first spec
> 3. Rollback transaction
> 4. Start another tr
"Todd Tyree" <[EMAIL PROTECTED]> writes:
> I'm seeing something strange and was just wondering if someone can confirm my
> assumptions for me:
>
> I have user model with a number of specs: some of them use fixtures and some
> of them don't. Today, while talking someone through some specs that ne
On Fri, Sep 19, 2008 at 3:42 PM, Mark Wilden <[EMAIL PROTECTED]> wrote:
> I don't know the exact mechanism, but if we want a table to be emply that
> might have had fixtures loaded into it at some point, we delete_all in
> before(). It seems to me that if you have fixtures, they would be loaded
>
On Fri, Sep 19, 2008 at 6:22 AM, Todd Tyree <[EMAIL PROTECTED]> wrote:
>
> I have user model with a number of specs: some of them use fixtures and
> some of them don't. Today, while talking someone through some specs that
> needed developming, I noticed that the fixtures always seemed to be
> lo
> Does your spec_helper file have this:
>
> Spec::Runner.configure do |config|
> config.use_transactional_fixtures = true
> end
>
Yes.
>
> Also, what versions of rspec and rails are you using?
1.1.4 and 2.1.0
Cheers,
Todd
___
rspec-users mailing l
Sorry, hit the enter key prematurely, That 'bit more concise' bit of the
spec should read:
describe User, "description" do
it "should not show emails" do
User.all.should be_blank
# Or, to be a bit more concise:
User.all.select{|u| u.email == '[EMAIL PROTECTED]
<[EMAIL PROTECTED]>'}.
On Fri, Sep 19, 2008 at 8:22 AM, Todd Tyree <[EMAIL PROTECTED]> wrote:
> I'm seeing something strange and was just wondering if someone can confirm
> my assumptions for me:
>
> I have user model with a number of specs: some of them use fixtures and
> some of them don't. Today, while talking someo
I'm seeing something strange and was just wondering if someone can confirm
my assumptions for me:
I have user model with a number of specs: some of them use fixtures and
some of them don't. Today, while talking someone through some specs that
needed developming, I noticed that the fixtures alway
23 matches
Mail list logo