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

bugfix: Undefined module/class Bundler when running cucumber-rails from RubyMine #810

Merged
merged 2 commits into from
Jun 18, 2021

Conversation

luke-hill
Copy link
Contributor

Bundler is a runtime dependency inside aruba/api/bundler - So require it as so

Summary

Fix gemspec to pull in bundler as a requirement of using the gem (As it's needed to run some methods)

Details

Self-explanatory

Motivation and Context

When running cucumber-rails in a test/valid context, this throws an error when consuming aruba helpers

How Has This Been Tested?

CI / Manual

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)
  • Documentation update
  • Internal change (refactoring, test improvements, developer experience or update of dependencies)

Checklist:

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

@luke-hill luke-hill requested a review from mvz June 2, 2021 14:44
@luke-hill
Copy link
Contributor Author

Only debate is whether it should be done this way or detected at runtime and required via another means?

@mvz
Copy link
Contributor

mvz commented Jun 13, 2021

Only debate is whether it should be done this way or detected at runtime and required via another means?

This is a tricky one. On the one hand, everyone uses Bundler. On the other hand, the error you encountered actually tells me not everyone uses Bundler. But then, why force it on people?

Also, I vaguely remember the transition from Bundler 1.x to 2.0 was difficult because many gems depended on Bundler 1.x.

Finally, if people want to use the Aruba::Api::Bundler they'll probably have Bundler installed.

So, I'm leaning toward doing some form of runtime check here.

@luke-hill
Copy link
Contributor Author

This error came about when running tests through RM. Which is a reasonably valid use case.

If we want to alter the runtime dependency to be more lax I'm happy to do that. But this does need adding in some way shape or form.

@mvz
Copy link
Contributor

mvz commented Jun 14, 2021

@luke-hill what is RM?

@luke-hill
Copy link
Contributor Author

Sorry. RubyMine, it's a popular IDE for ruby. So for me running Aruba I just click on a feature and click "run"

@mvz
Copy link
Contributor

mvz commented Jun 14, 2021

Ok, so using RubyMine leads to an error, but using just cucumber works?

@luke-hill
Copy link
Contributor Author

I believe so yes. But I only tested that adding this fixes the problem. I didn't dig deep into it as it felt not that big of an issue to add this as a runtime dep, because technically it is a runtime dep in this one area.

Can amend if you would prefer to something a bit more dynamic.

@mvz mvz changed the title bugfix: Undefined module/class Bundler when running cucumber-rails bugfix: Undefined module/class Bundler when running cucumber-rails from RubyMine Jun 17, 2021
@mvz
Copy link
Contributor

mvz commented Jun 17, 2021

Ok, so just to be clear:

  • In a project using Aruba, running a scenario using unset_bundler_env_vars through RubyMine fails.
  • If you add bundler as a dependency to that project, running the scenario through RubyMine no longer fails.

Correct?

Copy link
Contributor

@mvz mvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense from a dependency standpoint, whether we understand RubyMine's behaviour or not.

I have just one small nit; once that's fixed this can be merged.

aruba.gemspec Outdated Show resolved Hide resolved
@luke-hill luke-hill merged commit a4f4691 into main Jun 18, 2021
@luke-hill luke-hill deleted the bugfix/bundler_runtime_req branch June 18, 2021 13:30
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.

2 participants