pat / combustion

Simple, elegant testing for Rails Engines
MIT License
708 stars 51 forks source link

rails 4 support #51

Closed kjvarga closed 11 years ago

kjvarga commented 11 years ago

The Rails 4 RC 1 is out. Will combustion support it?

Also, how would I go about specifying the version of Rails that Combustion uses? Do I just specify it in my Gemfile e.g.

gem 'rails', '3.1.0'
gem 'combustion'
kjvarga commented 11 years ago

I actually just did a quick test and everything seemed to work!

I did get these deprecation warnings coming from Combustion's files tho:

DEPRECATION WARNING: config.whiny_nils option is deprecated and no longer works. (called from <top (required)> at /Users/karl/projects/sitemap_generator-test/Rakefile:2)
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  * development - set it to false
  * test - set it to false (unless you use a tool that preloads your test environment)
  * production - set it to true

/Users/karl/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/sitemap_generator/tasks_spec.rb
DEPRECATION WARNING: config.whiny_nils option is deprecated and no longer works. (called from <top (required)> at /Users/karl/projects/sitemap_generator-test/spec/spec_helper.rb:2)
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  * development - set it to false
  * test - set it to false (unless you use a tool that preloads your test environment)
  * production - set it to true

I just set my Rails version in the Gemfile as in the previous comment. Then I had to add the sqlite3 gem to the Gemfile even though I have sqlite3-ruby already and that had been working before. Also I had to update rspec-rails to the latest as well as the sqlite3 gems.

Then I just fixed some of my own deprecation warnings and everything seems okay.

pat commented 11 years ago

I would guess Combustion works fine with Rails 4, as there doesn't seem to be massive changes in most areas. Yes, you'll still need to specify Rails in your gemspec - I use the appraisals gem a fair bit to ensure my tests work against multiple versions of Rails (or other libraries).

@parndt has already patched Combustion to not set whiny_nils if the setting's not available - though I guess while it's just deprecated, it will still use the setting?

pat commented 11 years ago

Closing this, as @parndt's commits a while back seems to have it all sorted out. Latest release (0.5.1) certainly includes these changes.

andrewhavens commented 9 years ago

@pat I came across combustion in my search for a tutorial on how to test a Rails engine to support multiple versions of Rails. I added appraisals to my gemspec, but I'm wondering if you could add a short tutorial to the README which talks about configuring these two gems to work together (and mention that combustion works with Rails 4)?

pat commented 9 years ago

Thanks Andrew, that's a good suggestion. I've just updated the README to note Rails 4 support in the Compatibility section.

Also, when it comes to using it with Appraisal across Rails versions, Thinking Sphinx (another gem of mine) is probably a good place to look at as an example: https://github.com/pat/thinking-sphinx/blob/master/Appraisals https://github.com/pat/thinking-sphinx/blob/master/spec/spec_helper.rb