From 3683745cbc94a60e1cf60d86c9cb62f067182de3 Mon Sep 17 00:00:00 2001 From: Rohit Arondekar Date: Sun, 12 Sep 2010 21:05:10 -0700 Subject: Guides: Add test directory to load path to run individual test files. --- railties/guides/source/testing.textile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile index 6686dc3290..2355d2a31a 100644 --- a/railties/guides/source/testing.textile +++ b/railties/guides/source/testing.textile @@ -241,8 +241,7 @@ h4. Running Tests Running a test is as simple as invoking the file containing the test cases through Ruby: -$ cd test -$ ruby unit/post_test.rb +$ ruby -Itest test/unit/post_test.rb Loaded suite unit/post_test Started @@ -252,12 +251,12 @@ Finished in 0.023513 seconds. 1 tests, 1 assertions, 0 failures, 0 errors -This will run all the test methods from the test case. +This will run all the test methods from the test case. Note that +test_helper.rb+ is in the +test+ directory, hence this directory needs to be added to the load path using the +-I+ switch. You can also run a particular test method from the test case by using the +-n+ switch with the +test method name+. -$ ruby unit/post_test.rb -n test_truth +$ ruby -Itest test/unit/post_test.rb -n test_truth Loaded suite unit/post_test Started -- cgit v1.2.3 From b59a8d42c300651ad3384d4dab326454c088cbcc Mon Sep 17 00:00:00 2001 From: rohit Date: Tue, 14 Sep 2010 10:03:39 +0530 Subject: Application settings are specified in application.rb and not environment.rb --- .../rails/app/templates/config/environments/development.rb.tt | 2 +- .../generators/rails/app/templates/config/environments/production.rb.tt | 2 +- .../rails/generators/rails/app/templates/config/environments/test.rb.tt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt index 7616614aff..91d3133ea4 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt @@ -1,5 +1,5 @@ <%= app_const %>.configure do - # Settings specified here will take precedence over those in config/environment.rb + # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 500fc4d860..89bb891ddd 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -1,5 +1,5 @@ <%= app_const %>.configure do - # Settings specified here will take precedence over those in config/environment.rb + # Settings specified here will take precedence over those in config/application.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 26cdef071a..d8d1e55157 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -1,5 +1,5 @@ <%= app_const %>.configure do - # Settings specified here will take precedence over those in config/environment.rb + # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that -- cgit v1.2.3