Hi. I was working on #163 and as I mentioned there, it was a bit difficult for me to get familiar with the test suite, so I started to move things around and in the end I got these changes running. I know it's a lot, so I'll try to get a list of what I've done:
Merge all dummy apps
They were almost the same apps, I only had to insert a few version checks, e.g.: spec/rails_app/app/controllers/users_controller.rb. This way we have less code to maintain and easier to add a new spec for all versions.
Create a few gemfiles
This way you can run BUNDLE_GEMFILE=spec/gemfiles/Gemfile.rails-X.Y bundle install to install the gems and BUNDLE_GEMFILE=spec/gemfiles/Gemfile.rails-X.Y bundle exec rspec to run the specs. I think it's easier to delete and old version when we don't support it anymore. Not sure if we need to add something to the Readme about this.
Update github actions to pick up all versions
I had to define the bundler version for Rails 4.2 and exclude a few combunations, e.g. Rails 7 does not support older Ruby versions. Other than that we're running the full matrix.
Fix tests for Rails 6.1 & 7.0
In lib/axlsx_rails/railtie.rb we required the template handler only after action_view already loaded, which does not happen in the rspec for some reason. I simply moved the require line out from the on_load block. As it's just a simple plain old ruby class, it shouldn't do any harm - apart from loading the action_view unnecessarily... it was only required to have the template handler in ActionView's namespace (which we shouldn't do, all the gem codes should live under the gem's namespace anyways), so I also renamed the template handler and removed the inclusion of action_view
Delete all the .sh files as we don't need them anymore
I hope this all makes sense and we can merge it in to make this gem more maintainable
Hi. I was working on #163 and as I mentioned there, it was a bit difficult for me to get familiar with the test suite, so I started to move things around and in the end I got these changes running. I know it's a lot, so I'll try to get a list of what I've done:
Merge all dummy apps They were almost the same apps, I only had to insert a few version checks, e.g.:
spec/rails_app/app/controllers/users_controller.rb
. This way we have less code to maintain and easier to add a new spec for all versions.BUNDLE_GEMFILE=spec/gemfiles/Gemfile.rails-X.Y bundle install
to install the gems andBUNDLE_GEMFILE=spec/gemfiles/Gemfile.rails-X.Y bundle exec rspec
to run the specs. I think it's easier to delete and old version when we don't support it anymore. Not sure if we need to add something to the Readme about this.Update github actions to pick up all versions I had to define the bundler version for Rails 4.2 and exclude a few combunations, e.g. Rails 7 does not support older Ruby versions. Other than that we're running the full matrix.
Fix tests for Rails 6.1 & 7.0 In
lib/axlsx_rails/railtie.rb
we required the template handler only afteraction_view
already loaded, which does not happen in the rspec for some reason. I simply moved the require line out from theon_load
block. As it's just a simple plain old ruby class, it shouldn't do any harm - apart from loading theaction_view
unnecessarily... it was only required to have the template handler in ActionView's namespace (which we shouldn't do, all the gem codes should live under the gem's namespace anyways), so I also renamed the template handler and removed the inclusion ofaction_view
Delete all the
.sh
files as we don't need them anymoreI hope this all makes sense and we can merge it in to make this gem more maintainable