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

Add example failing test for td.explain(object). #217

Closed
wants to merge 1 commit into from

Conversation

Schoonology
Copy link
Contributor

This is just another random thought, but I found myself instinctively trying the following while test-driving a feature this week:

var bag = td.object(['some_method'])
...
td.explain(bag)

While it was immediately obvious both that we don't support this behaviour now and that what I wanted was td.explain(bag.some_method), it left me wondering how desirable this behaviour would be. I know it would require substantial changes to the way explain and store interact. (If it was easier, this PR would include the working feature!)

@searls
Copy link
Member

searls commented Mar 23, 2017

We've had this issue logged for a long time. #48

I think it's possible without too much rework. We can be a little deft about it if we just slam these objects/constructors into the store with added references of the test doubles that dangle off of them, and then branch accordingly in td.explain.

It'd be hacky to start storing heterogeneous data into the store so it might make sense to instantiate a second store and read from that one when td.explain is a miss on whatever's passed to it.

@jasonkarns jasonkarns added this to Backlog in Test Double Trouble Oct 1, 2021
@searls
Copy link
Member

searls commented Jul 14, 2022

Closing as stale

@searls searls closed this Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants