Skip to content

Reinstate inheritance integration spec#509

Open
cllns wants to merge 3 commits into
mainfrom
reinstate-inheritance-spec
Open

Reinstate inheritance integration spec#509
cllns wants to merge 3 commits into
mainfrom
reinstate-inheritance-spec

Conversation

@cllns
Copy link
Copy Markdown
Member

@cllns cllns commented Apr 24, 2026

resources used to be available in router, now it's in hanami/hanami

So this is a suitable replacement!

I also moved the module with its classes into the spec. I think of Fixtures as a place for shared things. It's easier to read this spec in isolation without having to go to fixtures file.

cllns added 2 commits April 23, 2026 23:16
'resources' used to be available in router, now it's in hanami/hanami

So this is a suitable replacement
Copy link
Copy Markdown
Member

@timriley timriley left a comment

Choose a reason for hiding this comment

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

Good to have this back, thank you!

This never really needed to be tied to resource-based organisation of actions in the first place, anyway. This is just straightforward testing of inheritance and its impact on callbacks/super, etc.

Comment thread spec/integration/inheritance_spec.rb Outdated
end
end

module Controllers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Future TODO: remove all instances of the "Controller" terminology even from our test class namespaces (I felt that was too much to bite off with the initial rename PR).

@timriley
Copy link
Copy Markdown
Member

@cllns Regarding fixtures — one of the things we avoid in this test suite by using fixtures is class names leaking between tests. Right now we don't have any machinery to clean up constants after tests, etc., so if we happened to want to define InheritanceSpec::Action in another example group, that would end up causing problems, I think.

Maybe we could use anonymous classes here to avoid that?

Named constants leak for the lifetime of the test suite, since
anonymous classes define no constants and are truly isolated.
@cllns
Copy link
Copy Markdown
Member Author

cllns commented Apr 27, 2026

Ah great point Tim. I switched to use anonymous classes. This require re-working the spec since we were passing the class name along, which anonymous classes don't have. Instead I used #object_id which is a suitable replacement.

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