Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Support Rails 5.2.X #376

Closed
wants to merge 1 commit into from
Closed

[WIP] Support Rails 5.2.X #376

wants to merge 1 commit into from

Conversation

roberts1000
Copy link

Summary

Allow cucumber-rails to bundle with projects that use Rails 5.2.X.

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@xtrasimplicity xtrasimplicity changed the title Support Rails 5.2.X [WIP] Support Rails 5.2.X Apr 11, 2018
@roberts1000
Copy link
Author

@xtrasimplicity @mvz I'm getting the following error

LoadError: cannot load such file -- bootsnap/setup

I'm not really sure why the test Rails apps can't find bootsnap. It appears to be in their Gemfile. Do you have any suggestions on how to get past that issue?

@xtrasimplicity
Copy link
Member

@roberts1000 The gems defined in the appraisal should be loaded when the temporary rails app starts, but if not you can force a gem to be added to the temporary application's gem file from within the step definitions.

The following should give you an idea of how we've handled this in the past. :)

def install_cucumber_rails(*options)
    [...] 
    # From Rails 5.1 some gems are already part of the Gemfile
    if Gem.loaded_specs['rails'].version < Gem::Version.new('5.1.0')
      gem 'capybara', group: :test
      gem 'selenium-webdriver', group: :test
    end
  [...] 
end

Source: features/step_definitions/cucumber_rails_steps.rb

Apologies for any strange formatting - I'm using my phone.

Hope this helps. :)

@roberts1000
Copy link
Author

Thanks for the suggestion! I gave it a shot but it doesn't seem to work with the updated Appraisal files or by modifying install_cucumber_rails. I wonder if there's something specific to bootsnap that is causing problems.

@xtrasimplicity
Copy link
Member

@roberts1000 What version of bootsnap is listed in the Gemfile.lock file in the temporary app's root directory? A quick google suggests it could be a version issue (though I doubt it, given you've specified >= 1.1.0, and a Google search suggest it occurs on versions < 1.0).

@roberts1000
Copy link
Author

roberts1000 commented Apr 15, 2018

It has gem 'bootsnap', '>= 1.1.0', require: false. The temporary rails app is correctly using gem 'rails', '~> 5.2.0 (although the app folder is named rails-3-app). If I cd into the /home/.../cucumber-rails/tmp/aruba/rails-3-app folder and run bundle, the temp app bundles fine. I can also start the rails server and send requests to it without a problem.

@xtrasimplicity
Copy link
Member

@roberts1000 What is printed to stdout when you use the @announce tag? Could you please copy and paste it into a Gist?

https://relishapp.com/cucumber/aruba/v/0-9-0/docs/announce-output-during-test-run

@xtrasimplicity
Copy link
Member

I'm going to close this, as it is covered by #378 - which will soon be merged. Thanks for all of your effort, @roberts1000!

@roberts1000 roberts1000 deleted the add_rails_5.2_support branch April 23, 2018 22:02
@roberts1000
Copy link
Author

Thanks for helping with this PR and getting the problem solved in the other PR! Wish I could have done more, but I got sidetracked by Rails Conf and travel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants