caxlsx / caxlsx_rails

A Rails plugin to provide templates for the axlsx gem
MIT License
742 stars 84 forks source link

doc: fix README shared_context code given for testing #183

Closed esquinas closed 3 months ago

esquinas commented 3 months ago

Solves issue #182 "Example code for testing given in README produces NameError"

esquinas commented 3 months ago

Maybe in the future you could provide the test helper like this instead of in the README

# spec/support/shared_examples/axlsx.rb

require "caxlsx_rails/test_helper"
# ...
straydogstudio commented 3 months ago

@esquinas Do you know what Rails version this became effective in?

If it is new enough, it would be good to comment out the old line and indicate what version of Rails it is used in.

esquinas commented 3 months ago

@straydogstudio I think this is independent of the Rails version. We use this gem and it failed during CI/CD just by doing a dependabot update of caxlsx_rails from 0.6.3 to 0.6.4 Now, in older Rails versions, the AxlsxRails::TemplateHandle class is going to be available because it belongs to the gem, not to Rails.

timdiggins commented 3 months ago

@straydogstudio I can confirm same thing for me.

FYI The change to the namespace & name of the class came in https://github.com/caxlsx/caxlsx_rails/pull/164

esquinas commented 3 months ago

@straydogstudio Sorry to insist, I write again just to make sure you are not waiting for me to solve the failed CI tests.

I am not solving them because the failed CI tests look like flaky setup stuff like this:

An error occurred while installing sqlite3 (1.6.9), and Bundler cannot continue.

In Gemfile.rails-5.2:
  sqlite3
Error: The process '/opt/hostedtoolcache/Ruby/2.4.10/x64/bin/bundle' failed with exit code 5

I think/hope the failures will go away if you re-run the Github actions. I do not have permissions to re-run them (or I cannot find where to click)

Thanks.

straydogstudio commented 3 months ago

@esquinas Yeah it does seem like flaky setup. It is always ruby 2.4. So far rerunning hasn't helped.

I'll add it anyway for now.