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

Replace Testt::Spec with Test2::Tools::Spec #813

Merged
merged 19 commits into from
Aug 30, 2024
Merged

Conversation

gugod
Copy link
Owner

@gugod gugod commented Aug 25, 2024

Test2::Tools::Spec provides most of the features implemented in Test::Spec and is nearly a drop-in replacement.

Uses of methods from Test::Spec::Mocks needs to be reworked, namely when expects are being used.

@gugod gugod changed the title Replace test spec Replace Testt::Spec with Test2::Tools::Spec Aug 25, 2024
@lukec
Copy link
Contributor

lukec commented Aug 26, 2024

This looks cleaner than how I did it in t/installation2.t - nice work!

@gugod
Copy link
Owner Author

gugod commented Aug 28, 2024

This looks cleaner than how I did it in t/installation2.t - nice work!

Thanks.

Test2::Tools::Mock ended up being pretty decent by itself, even without the interfaces of Test2::Mock.

Furthermore... after your comment... when I started to rewrite more tests, I found out that
due to the extensive use of Test::Spec and actually Test::Spec::Mock, it became rather cumbersome to rewrite t/command-exec.t with just Test2::Tools::Mock and it doesn't look like Test2::Mock would make the rewrite easier... so I latter decided to make a similar version of Test2::Tools::Mock instead, named Mocked, in test2_helper.pl. It's not a drop-in replacement, but something that provides similar API , with somewhat manageable amount of changes on the caller side. That makes it a whole lot easier for the purpose of using Test2-based subroutines.

@gugod gugod merged commit 9a786cd into develop Aug 30, 2024
10 checks passed
@gugod gugod deleted the replace-test-spec branch August 30, 2024 00:45
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