Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 6 - Rspec-rails should be "group :development, :test" #48

Open
ACPK opened this issue Nov 3, 2015 · 3 comments
Open

Chapter 6 - Rspec-rails should be "group :development, :test" #48

ACPK opened this issue Nov 3, 2015 · 3 comments

Comments

@ACPK
Copy link

ACPK commented Nov 3, 2015

In the end of Chapter 6, the 'rspec-rails' gem is in "group :test". I'd recommend adding it to "group :development, :test" so that it works for rake tasks and generators.

See: https://github.com/rspec/rspec-rails#installation

@kurenn
Copy link
Owner

kurenn commented Nov 3, 2015

I'll include it on next version of the book, you can always send me a pull request ;)

@leo-le-07
Copy link

I'm a new rubyist so I don't know what is the difference between test and development group ?
What will happen if we have only test or development group ?
Thanks

@kurenn
Copy link
Owner

kurenn commented May 5, 2016

It is just a way to organize your gems, which are dependencies which your application rely on.

In rails you have minimum 3 environments, development, test and production, and this is important in this case because the group where you add the gems are the ones where they are going to be actually require.

For development purposes you don't have to worry about it, everything works as expected, the caveat comes with production, if you deploy to production, let's say on heroku, you will see that when it runs the bundle command it runs something like:

bundle install --without test development

This is because you are not actually going to use a factory gem to create your data as with testing for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants