Skip to content

Commit

Permalink
Require test gems in development environment, not test
Browse files Browse the repository at this point in the history
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
emk committed Feb 2, 2009
1 parent 15372c4 commit 5c568b5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
14 changes: 6 additions & 8 deletions README
Expand Up @@ -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

Expand Down
15 changes: 14 additions & 1 deletion config/environments/development.rb
Expand Up @@ -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'
10 changes: 0 additions & 10 deletions config/environments/test.rb
Expand Up @@ -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'

0 comments on commit 5c568b5

Please sign in to comment.