Johnny Holton
2013-Apr-19 17:34 UTC
Can I run a specific test against a specific database?
I have written a test. I want to run only it against all the database options (sqlite, mysql, mysql2, postgres). bundle exec ruby -I test test/cases/autosave_association_test.rb -n test_my_cool_test This runs only my test, but uses only sqlite3. Can I force it to use mysql2? I know I can also do: TEST_DIR=cases bundle exec rake test_mysql2 But this runs all the test in all the files in that directory, which is a lot. Can I be more specific with this method of test running? Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Rafael Mendonça França
2013-Apr-19 18:32 UTC
Re: Can I run a specific test against a specific database?
https://github.com/rails/rails/blob/master/activerecord/RUNNING_UNIT_TESTS.rdoc#running-the-tests Hope this help. Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca On Fri, Apr 19, 2013 at 2:34 PM, Johnny Holton <johnnyholton@gmail.com>wrote:> I have written a test. > I want to run only it against all the database options (sqlite, mysql, > mysql2, postgres). > > bundle exec ruby -I test test/cases/autosave_association_test.rb -n > test_my_cool_test > > This runs only my test, but uses only sqlite3. > > Can I force it to use mysql2? > > I know I can also do: > TEST_DIR=cases bundle exec rake test_mysql2 > But this runs all the test in all the files in that directory, which is a > lot. Can I be more specific with this method of test running? > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-core+unsubscribe@googlegroups.com. > To post to this group, send email to rubyonrails-core@googlegroups.com. > Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Johnny Holton
2013-Apr-22 18:38 UTC
Re: Can I run a specific test against a specific database?
Perfect. Thanks. On Friday, April 19, 2013 2:32:34 PM UTC-4, Rafael Mendonça França wrote:> > > https://github.com/rails/rails/blob/master/activerecord/RUNNING_UNIT_TESTS.rdoc#running-the-tests > > Hope this help. > > Rafael Mendonça França > http://twitter.com/rafaelfranca > https://github.com/rafaelfranca > > > On Fri, Apr 19, 2013 at 2:34 PM, Johnny Holton <johnny...@gmail.com<javascript:> > > wrote: > >> I have written a test. >> I want to run only it against all the database options (sqlite, mysql, >> mysql2, postgres). >> >> bundle exec ruby -I test test/cases/autosave_association_test.rb -n >> test_my_cool_test >> >> This runs only my test, but uses only sqlite3. >> >> Can I force it to use mysql2? >> >> I know I can also do: >> TEST_DIR=cases bundle exec rake test_mysql2 >> But this runs all the test in all the files in that directory, which is a >> lot. Can I be more specific with this method of test running? >> >> Thanks! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-co...@googlegroups.com <javascript:>. >> To post to this group, send email to rubyonra...@googlegroups.com<javascript:> >> . >> Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en >> . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. For more options, visit https://groups.google.com/groups/opt_out.