Joshua Partogi
2010-Oct-12 23:26 UTC
The development env is loaded before the test env when running unit test
HI all, When I print Rails.env in one of my initializer, I noticed that the dev env is loaded first before the test env. There are some bits that I don''t want to run for unit testing (i.e background job). Is there any way to setup Rails not to run the development env when unit test is ran? Thanks heaps in advance for your help. Kind regards, Joshua. -- http://twitter.com/scrum8 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Greg Donald
2010-Oct-12 23:32 UTC
Re: The development env is loaded before the test env when running unit test
On Tue, Oct 12, 2010 at 6:26 PM, Joshua Partogi <jpartogi-YxiBlgEkUCTQT0dZR+AlfA@public.gmane.org> wrote:> HI all, > > When I print Rails.env in one of my initializer, I noticed that the dev env > is loaded first before the test env. There are some bits that I don''t want > to run for unit testing (i.e background job). Is there any way to setup > Rails not to run the development env when unit test is ran? > > Thanks heaps in advance for your help. > > > Kind regards, > Joshua.unless Rails.env == ''test'' # skip these bits end -- Greg Donald destiney.com | gregdonald.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Joshua Partogi
2010-Oct-13 03:29 UTC
The development env is loaded before the test env when running unit test
HI all, When I print Rails.env in one of my initializer, I noticed that the dev env is loaded first before the test env. There are some bits that I don''t want to run for unit testing (i.e background job). Is there any way to setup Rails not to run the development env when unit test is ran? Thanks heaps in advance for your help. Kind regards, Joshua. -- http://twitter.com/scrum8 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.