szimek
2008-Mar-13 21:06 UTC
Test passes when run isolated, fails when run using "rake test"
Hi, I got very simple unit test (creates new object and checks if it''s successfuly saved) that passes when I run only the file, which contains this test, but fails when I run "rake test". Any ideas what can be wrong? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-13 21:34 UTC
Re: Test passes when run isolated, fails when run using "rake test"
On 13 Mar 2008, at 21:06, szimek wrote:> > Hi, > > I got very simple unit test (creates new object and checks if it''s > successfuly saved) that passes when I run only the file, which > contains this test, but fails when I run "rake test". >Tests tend to assume that each individual test is isolated from subsequent ones. If this isn''t the case then you can see things similar to what you describe. A common one is having transactional fixtures turned on but the database not supporting transactions (if you''re using mysql and it has defaulted to myisam tables) and things like that. Fred> Any ideas what can be wrong? > > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-
szimek
2008-Mar-13 22:27 UTC
Re: Test passes when run isolated, fails when run using "rake test"
On 13 Mar, 22:34, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 13 Mar 2008, at 21:06, szimek wrote: > > > > > Hi, > > > I got very simple unit test (creates new object and checks if it''s > > successfuly saved) that passes when I run only the file, which > > contains this test, but fails when I run "rake test". > > Tests tend to assume that each individual test is isolated from > subsequent ones. If this isn''t the case then you can see things > similar to what you describe. > A common one is having transactional fixtures turned on but the > database not supporting transactions (if you''re using mysql and it has > defaulted to myisam tables) and things like that. > > Fred > > > Any ideas what can be wrong? > > > --~--~---------~--~----~------------~-------~--~----~ > > You received this message because you are subscribed to the Google > > Groups "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails- > > > > smime.p7s > 5KPobierzThanks! That was it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---