Brian Cardarella
2009-Sep-02 03:02 UTC
[rspec-users] Issue with ActiveRecord::Base.transaction in RSpec
I have this example: http://pastie.org/602476 If I run it, it on the 2nd ''Country.count.should == 0'' If I run the exact same code in ''script/console test'' (so in the same environment) it works just fine. But not within an RSepc example. Any thoughts?
David Chelimsky
2009-Sep-02 07:11 UTC
[rspec-users] Issue with ActiveRecord::Base.transaction in RSpec
On Tue, Sep 1, 2009 at 10:02 PM, Brian Cardarella<bcardarella at gmail.com> wrote:> I have this example: > > http://pastie.org/602476 > > If I run it, it on the 2nd ''Country.count.should == 0''There''s a verb missing :) I think you mean that "If I run it, it _fails_ on the 2nd ...", yes? What is the failure message you''re getting? Does it say "expected 0, got 1" or is there some other error?> > If I run the exact same code in ''script/console test'' (so in the same > environment) it works just fine. But not within an RSepc example. Any > thoughts? > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Brian Cardarella
2009-Sep-02 07:19 UTC
[rspec-users] Issue with ActiveRecord::Base.transaction in RSpec
Dave, Yes, verb failure :) I think this might be an issue of me using Sqlite3 as my DB. Let me port over to Postgres and test that out. Hopefully just a false alarm. - Brian On Sep 2, 3:11?am, David Chelimsky <dchelim... at gmail.com> wrote:> On Tue, Sep 1, 2009 at 10:02 PM, Brian Cardarella<bcardare... at gmail.com> wrote: > > I have this example: > > >http://pastie.org/602476 > > > If I run it, it on the 2nd ''Country.count.should == 0'' > > There''s a verb missing :) I think you mean that "If I run it, it > _fails_ on the 2nd ...", yes? > > What is the failure message you''re getting? Does it say "expected 0, > got 1" or is there some other error? > > > > > If I run the exact same code in ''script/console test'' (so in the same > > environment) it works just fine. But not within an RSepc example. Any > > thoughts? > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
David Chelimsky
2009-Sep-02 07:34 UTC
[rspec-users] Issue with ActiveRecord::Base.transaction in RSpec
On Wed, Sep 2, 2009 at 2:19 AM, Brian Cardarella<bcardarella at gmail.com> wrote:> Dave, > > ? Yes, verb failure :) > > ? I think this might be an issue of me using Sqlite3 as my DB. Let me > port over to Postgres and test that out. Hopefully just a false alarm.Cool - let us know. Cheers, David> > - Brian > > On Sep 2, 3:11?am, David Chelimsky <dchelim... at gmail.com> wrote: >> On Tue, Sep 1, 2009 at 10:02 PM, Brian Cardarella<bcardare... at gmail.com> wrote: >> > I have this example: >> >> >http://pastie.org/602476 >> >> > If I run it, it on the 2nd ''Country.count.should == 0'' >> >> There''s a verb missing :) I think you mean that "If I run it, it >> _fails_ on the 2nd ...", yes? >> >> What is the failure message you''re getting? Does it say "expected 0, >> got 1" or is there some other error? >> >> >> >> > If I run the exact same code in ''script/console test'' (so in the same >> > environment) it works just fine. But not within an RSepc example. Any >> > thoughts? >> > _______________________________________________ >> > rspec-users mailing list >> > rspec-us... at rubyforge.org >> >http://rubyforge.org/mailman/listinfo/rspec-users >> >> _______________________________________________ >> rspec-users mailing list >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Brian Cardarella
2009-Sep-02 07:38 UTC
[rspec-users] Issue with ActiveRecord::Base.transaction in RSpec
False alarm, it was because of Sqlite3. Sorry! - Brian On Sep 2, 3:19?am, Brian Cardarella <bcardare... at gmail.com> wrote:> Dave, > > ? ?Yes, verb failure :) > > ? ?I think this might be an issue of me using Sqlite3 as my DB. Let me > port over to Postgres and test that out. Hopefully just a false alarm. > > - Brian > > On Sep 2, 3:11?am, David Chelimsky <dchelim... at gmail.com> wrote: > > > > > On Tue, Sep 1, 2009 at 10:02 PM, Brian Cardarella<bcardare... at gmail.com> wrote: > > > I have this example: > > > >http://pastie.org/602476 > > > > If I run it, it on the 2nd ''Country.count.should == 0'' > > > There''s a verb missing :) I think you mean that "If I run it, it > > _fails_ on the 2nd ...", yes? > > > What is the failure message you''re getting? Does it say "expected 0, > > got 1" or is there some other error? > > > > If I run the exact same code in ''script/console test'' (so in the same > > > environment) it works just fine. But not within an RSepc example. Any > > > thoughts? > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-us... at rubyforge.org > > >http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users