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

Allow mocks to be moved. #334

Merged
merged 1 commit into from
May 10, 2024
Merged

Allow mocks to be moved. #334

merged 1 commit into from
May 10, 2024

Conversation

FranckRJ
Copy link
Collaborator

@FranckRJ FranckRJ commented May 9, 2024

Make mocks move-constructible, so they can be constructed from external functions. They could technically be move-assignable as well but I don't think it would be useful so I haven't done it.

They cannot be copy-constructible because the mocks can contain move-only objects (if a function returning a move-only object is mocked with Return(MoveOnly{}) then the mock will contain the move-only object that should be returned when that function is called), making them move-only as well.

This should fix #283 and #97.

@FranckRJ FranckRJ added this to the 2.5.0 milestone May 9, 2024
@coveralls
Copy link

coveralls commented May 9, 2024

Coverage Status

coverage: 99.926%. remained the same
when pulling 9428cd7 on allow-moves-on-mocks
into 52f86a8 on dev.

@FranckRJ FranckRJ force-pushed the allow-moves-on-mocks branch from 5f19982 to bb569e5 Compare May 10, 2024 14:50
@FranckRJ FranckRJ force-pushed the allow-moves-on-mocks branch from bb569e5 to 9428cd7 Compare May 10, 2024 14:51
@FranckRJ FranckRJ merged commit c1d74ea into dev May 10, 2024
72 checks passed
@FranckRJ FranckRJ deleted the allow-moves-on-mocks branch May 10, 2024 15:17
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