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

Make more tests using parsing for their input #349

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Aug 6, 2024

While a bit wasteful, writing the test input as a real RBI string rather than crafting in manually using the RBI classes is much easier to write/read.

Especially around nested scopes:

tree = parse_rbi(<<~RBI)
  class Foo
    class Bar
      class Baz; end
    end
  end
RBI

makes it easier to understand the scope hierarchy than:

tree = Tree.new
scope1 = Class.new("Foo")
scope2 = Class.new("Bar")
scope2 << Class.new("Baz")
scope1 << scope2
tree << scope1

@Morriar Morriar added the chore Chore task label Aug 6, 2024
@Morriar Morriar self-assigned this Aug 6, 2024
@Morriar Morriar requested a review from a team as a code owner August 6, 2024 15:40
@Morriar Morriar requested review from egiurleo and KaanOzkan August 6, 2024 15:40
Copy link
Contributor

@egiurleo egiurleo left a comment

Choose a reason for hiding this comment

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

This is waaaaay better

Base automatically changed from at-fix-parse-type-member to main August 6, 2024 20:22
@Morriar Morriar merged commit 0e9f771 into main Aug 6, 2024
8 checks passed
@Morriar Morriar deleted the at-clean-tests branch August 6, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants