pat / combustion

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

Support for Rails 5 #94

Closed utkarsh2102 closed 5 years ago

utkarsh2102 commented 5 years ago

Tests are failing for Rails 5. Please include the same.

Here are the logs:

Failures:

  1) Combustion::Database run migration from dummy engine
     Failure/Error: Combustion.initialize! :active_record

     NoMethodError:
       undefined method `migrate' for ActiveRecord::Migrator:Class
     # ./spec/database_spec.rb:8:in `block (3 levels) in <module:Combustion>'
     # ./spec/database_spec.rb:7:in `chdir'
     # ./spec/database_spec.rb:7:in `block (2 levels) in <module:Combustion>'

Finished in 0.96111 seconds (files took 0.49798 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/database_spec.rb:12 # Combustion::Database run migration from dummy engine
pat commented 5 years ago

I'm finding the tests are passing for me… can you confirm how you're running the tests, and which versions of Rails and Ruby you're using? I've just given them a spin on both MRI 2.5.3 and 2.6.0 (using the latest Rails releases in each of the 5.0, 5.1 and 5.2 series), and haven't hit any problems.

pat commented 5 years ago

Closing this issue as it's been dormant for a month. If you're still seeing issues, please do comment here anyway.

lukeasrodgers commented 1 year ago

Not sure if this is related, but I'm getting a similar error with rails 5.2 and ruby 3.0

An error occurred while loading rails_helper.
Failure/Error:
  Combustion.initialize! :active_record, :action_controller, :action_view, :sprockets do
    config.assets.compile = true
    config.assets.compress = false
    config.assets.debug = false
    config.assets.digest = false
  end

ArgumentError:
  wrong number of arguments (given 3, expected 2)

Tracing through the code, it seems to be caused by the build_middleware_stack initializer. I can dig into this some more.

pat commented 1 year ago

@lukeasrodgers if you're able to provide a full stack trace, that'd be great! :)

lukeasrodgers commented 1 year ago

Yeah I will see if I can - something is eating it

lukeasrodgers commented 1 year ago

@pat sorry false alarm - my testing setup wasn't using the right ruby version and running into kwargs issues with some activemodel code calling super

pat commented 1 year ago

All good, glad to know you got it figured out :)