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

Single threaded ActorRefs for unit testing #177

Open
christopinka opened this issue Jun 13, 2023 · 4 comments
Open

Single threaded ActorRefs for unit testing #177

christopinka opened this issue Jun 13, 2023 · 4 comments

Comments

@christopinka
Copy link

Is there a way to get ActorRefs for unit testing without the system context? actor_cell.rs isn't a public mod?

Does it make sense to be able to use ExtendedCell::new() in unit tests?

@hardliner66
Copy link
Contributor

hardliner66 commented Jun 14, 2023

IIRC, there isn't and shouldn't be a way. You need a system to run the actors anyway.

Also, note that there has been no development on riker since 2021.

@christopinka
Copy link
Author

Understood. How do you recommend unit testing behavior in receive function? Thanks

@christopinka
Copy link
Author

Do you know of any plans to handoff the project to other owners?

@hardliner66
Copy link
Contributor

There were plans to create an organization or something similar, but it never became reality. The original author disappeared multiple times already, without a leaving a clue on what is going on.

You are probably better of using a different framework like stakker or coerce.

As to your original question:
You can just set up a system and spawn the actor you want to test and send appropriate messages to it. If the actor needs other actors, you can pass the actor refs to an actor who handles the same messages as the real one, but provides mock behavior for that test.

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

No branches or pull requests

2 participants