nviennot / rspec-console

Run RSpec tests in your rails console
101 stars 20 forks source link

Remove the dependency of the "rails_env_switcher" #12

Closed taiki45 closed 10 years ago

taiki45 commented 10 years ago

Hi! I tried to remove rails_env_switcher.

  • Remove the dependency of the "rails_env_switcher".
  • Force people to use "rails c test" to launch the console.
  • emit a warning if "cache_classes = true" in the config/environment/test.rb file.

I'm not sure this implementation is better or not. So please give comments. I will improve this :)


I think Runner class should be refactored later if implements for non-Rails use case.

What do you think about non-Rails use case now? I guess you plan to do that from your code. :eyes:

nviennot commented 10 years ago

This already looks great. We need to include something to register hooks before the tests are ran. We need to register the following hook: FactoryGirl.reload if defined?(FactoryGirl) that was in the rails en switcher.

non-rails usecase is supported (although non rails apps don't take ages to load, using the shell is typically just fine).

nviennot commented 10 years ago

(Also we should call reload! if we are on rails).

nviennot commented 10 years ago

All done :) Thank you very much :)

Do we need anything else on rspec-console?

taiki45 commented 10 years ago

Great, Thank you! :+1:

Do we need anything else on rspec-console?

In this topic, I'm sure all are done :tada: :tada:

I'm not sure it is need or not but sometimes I want rspec-console to disable Rails logger when started console. I don't know that should be handled by user's config/environments/test.rb or spec/spec_helper.rb not rspec-console.

taiki45 commented 10 years ago

Oops, I found a typo in README #13

nviennot commented 10 years ago

Thanks :)

About the Rails logger, I find it useful to show database queries sometimes. Perhaps it would be useful to turn the debugging mode of the logger on STDERR when passing --verbose to rspec. But that might be better handled by rspec-rails or something.

taiki45 commented 10 years ago

that might be better handled by rspec-rails or something.

I agree.

Thanks for reviewing and updating!