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

Prevent collisions on let(:name) and let(:method_name) #2467

Merged
merged 2 commits into from
Feb 21, 2021
Merged

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Feb 20, 2021

This is #2461 for main

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -0,0 +1,57 @@
if __FILE__ =~ /^snippets/
Copy link
Member

Choose a reason for hiding this comment

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

Just a note that we have no support for snippets in main, the code to run them is in rails-6-1-dev only.
But if CI passes on rails-6-1-dev, the patch should most possibly work for main, too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it easy-ish to backport that support?

Copy link
Member

Choose a reason for hiding this comment

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

Should be easy. Looks like cherry-picking 040fecc and accepting the removed lines from Gemfile should do it.

pirj and others added 2 commits February 21, 2021 16:42
Snippet is a self-contained example that defines the configuration,
Rails project code and specs to run.

Snippets:
 - allow for clean separation between different snippets
 - work quite fast
 - reuse the already installed gems that specs and Cukes use
 - do not litter
 - do not depend on other parts of the build

In theory snippets retain the ability to use generators and arbitrary
commands, but it makes the case under test less evident.

Co-authored-by: Benoit Tigeot <benoit@hopsandfork.com>
Prevent collisions on let(:name) and let(:method_name)
@pirj
Copy link
Member

pirj commented Feb 21, 2021

Cherry-picked along with Changelog changes. Let's see if snippets are being run.

@pirj
Copy link
Member

pirj commented Feb 21, 2021

Nice

============= Starting snippets ===============
Running avoid_fixture_name_collision.rb
.

Finished in 0.00988 seconds (files took 0.4626 seconds to load)
1 example, 0 failures

Running use_active_record_false.rb
.

Finished in 0.00749 seconds (files took 0.49572 seconds to load)
1 example, 0 failures

============= Ending snippets ===============

@pirj pirj merged commit 324e98e into main Feb 21, 2021
@pirj pirj deleted the let-name-collision branch February 21, 2021 14:04
This was referenced Mar 7, 2021
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.

3 participants