Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Require test gems in development environment, not test

After experimenting a bit, this looks like a simpler approach.  It
allows developers to run:

  rake gems:install

...and it allows users to run:

  export RAILS_ENV=production
  rake gems:install

Thank you to mat for his work on this!
  • Loading branch information...
commit 5c568b5587cd3df6021e80e021485db75d3b9e44 1 parent 15372c4
@emk emk authored
View
14 README
@@ -16,17 +16,15 @@ XXX oh, we can't depend on the rails helpers at all, because they don't
translate the time from UTC (assuming the TZ env var is correctly
set) to site time, you've to roll our own, or monkey patch rails :/
-= Tests
+= Dependencies
-First make sure you have configured a test database in config/database.yml.
+Note that Mephisto depends on fewer gems when RAILS_ENV=production than it
+does in a development environment.
-Running the tests requires installing additional gems
+Run 'rake gems:install' to install the development gems. In a production
+environment, run:
- sudo rake gems:install RAILS_ENV=test
-
-You can now run the tests
-
- rake test
+ RAILS_ENV=production rake gems:install
= License
View
15 config/environments/development.rb
@@ -13,4 +13,17 @@
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
+config.action_mailer.raise_delivery_errors = false
+
+# These libraries are needed for our tests and specs. We include them
+# here, and not in test.rb, because (1) it's easier to run 'rake
+# gems:install' from the development environment than from the test
+# environment, and (2) anyone doing Mephisto development should _really_ be
+# running the tests anyway.
+config.gem 'ruby-debug'
+config.gem 'faker', :version => '>= 0.3.1'
+config.gem 'notahat-machinist', :version => '>= 0.1.2', :lib => 'machinist',
+ :source => 'http://gems.github.com'
+config.gem 'nokogiri', :version => '>= 1.1.0' # Used by webrat.
+config.gem 'brynary-webrat', :version => '>= 0.3.2.2', :lib => 'webrat',
+ :source => 'http://gems.github.com'
View
10 config/environments/test.rb
@@ -8,13 +8,3 @@
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
- # These libraries are needed for our tests and specs.
-config.gem 'faker', :version => '>= 0.3.1'
-config.gem 'notahat-machinist', :version => '>= 0.1.2', :lib => 'machinist',
- :source => 'http://gems.github.com'
-config.gem 'nokogiri', :version => '>= 1.1.0' # Used by webrat.
-config.gem 'brynary-webrat', :version => '>= 0.3.2.2', :lib => 'webrat',
- :source => 'http://gems.github.com'
-
-config.gem 'ruby-debug'
-
Please sign in to comment.
Something went wrong with that request. Please try again.