I have some testcases that involve many fixtures to perform one or two of the tests. However, the other 10 tests in that testcase don''t rely on those fixtures, yet are all the fixtures being loaded in and dropped between every test method? If so, how can I avoid this with out bunching up tests into categories like "these need all these fixtures" and "these dont..." -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Keynan Pratt
2008-Apr-06 08:00 UTC
Re: avoiding inserting and removing fixtures in testing
Don''t write your test such that class X has test XSpec or XTest instead write tests based on the context of what your testing ie a Stack element might have 3 test suites describe EmptyStack do describe StackWithElements do describe StackIsFull do -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-Apr-06 10:05 UTC
Re: avoiding inserting and removing fixtures in testing
On Apr 5, 11:36 pm, Aryk Grosz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have some testcases that involve many fixtures to perform one or two > of the tests. > > However, the other 10 tests in that testcase don''t rely on those > fixtures, yet are all the fixtures being loaded in and dropped between > every test method? >If you are using transactional fixtures (it''s the default), then fixtures are loaded only once per test run. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---