guard/guard-rspec — Issue #93: Guard running specs in :development regardless of gemfile
Author: danielberkompas
Created: 2012-01-27 19:30:33+00:00
State: open

See [this link](http://stackoverflow.com/questions/9038682/factory-girl-saving-to-development-database) for a description of the problem that I'm having.

It seems that guard is running development mode regardless of which group it is in in the `Gemfile`. This causes FactoryGirl to use the development database instead of the test database.

However, if I start guard this way: `RAILS_ENV=test bundle exec guard` it runs everything in test mode like it should. This continues even if I change my gemfile to read:

# Testing Gems
gem "factory_girl_rails", :group => :test
gem "guard", :group => :test
gem "guard-rspec", :group => :test

group :development do
gem "capybara"
gem "rspec-rails"
gem "ruby_gntp", :require => false
gem "addressable"
gem "launchy"
end

This seems to be a guard bug; shouldn't it recognize that it is in the test group and run in test mode?