Skip to content

Conversation

@Earlopain
Copy link
Collaborator

Of course, these won't really be fixtures, but it allows to test against whole codebases without copying them, doing symlinks or something like that.

For example, I can tell that over the whole RuboCop codebase, there are only 8 files that produce mismatched ast. Telling what the problem is is a different problem. The ast for real files can and will be huge so I haven't checked (maybe parser bug) but it's nice for discoverability regardless

# matches the snapshot.
assert_equal(saved, printed)
else
elsif !Fixture.custom_base_path?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you change this to just skip this whole test if there's a custom base path? I found it confusing to have this case in here.

Something like return if Fixture.custom_base_path? at the top after the test helper require would probably work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, that's cleaner

@Earlopain Earlopain force-pushed the tests-custom-fixtures branch from 8a46052 to 9b322b0 Compare January 17, 2025 07:50
Of course, these won't really be fixtures, but it allows to test against whole codebases
without copying them, doing symlinks or something like that.

For example, I can tell that over the whole RuboCop codebase, there are only 8 files that produce mismatched ast.
Telling what the problem is is a different problem. The ast for real files can and will be huge so I haven't checked yet
(maybe parser bug) but it's nice for discoverability regardless
@Earlopain Earlopain force-pushed the tests-custom-fixtures branch from 9b322b0 to 2184d82 Compare January 17, 2025 07:53
@kddnewton kddnewton merged commit 28dc4ff into ruby:main Jan 20, 2025
57 checks passed
@Earlopain Earlopain deleted the tests-custom-fixtures branch January 20, 2025 19:20
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