GitLab...4::Mock(3pm)
π GitLab...4::Mock(3pm) π
okay bestie, listen β this page is from the User Contributed Perl Documentation crew, and it's about GitLab::API::v4::Mock, aka your new fave little test buddy. it's giving "fake it till you make it" but, like, in a good way π«Ά
β¨ NAME β¨
GitLab::API::v4::Mock β Mock API object for testing. literally what it says on the tin, no cap π
πΈ SYNOPSIS πΈ
okay so here's the whole vibe in four lines:
use GitLab::API::v4::Mock;
my $api = GitLab::API::v4::Mock->new();
that's it. that's the whole thing. iconic β¨
π¦ DESCRIPTION π¦
so this module is a subclass of GitLab::API::v4 π. it doesn't reinvent anything, it just takes the normal one and modifies it so the REST client gets mocked, courtesy of GitLab::API::v4::Mock::RESTClient. it's like putting a little costume on your API object, honestly adorable π
and the whole point? writing unit tests π . that's it, that's the assignment. if you're out here testing your code without hitting the real GitLab servers, this is your girl. periodt.
π ATTRIBUTES π
two attributes got a lil glow-up here. let's get into it π
π« url
this one is altered from url in GitLab::API::v4 β two changes, both slay:
- it now defaults to
https://example.com/api/v4π - and it's not required anymore, so you can justβ¦ not set it. freedom. iconic.
π« rest_client_class
also altered, this time from rest_client_class in GitLab::API::v4 π. the glow-up? it now defaults to GitLab::API::v4::Mock::RESTClient, so the mocking just happens without you lifting a finger. the way that it handles itself for youβ¦ obsessed π
π SUPPORT π
need help? go peep "SUPPORT" in GitLab::API::v4 β it's all over there, bestie π«Ά
π AUTHORS π
the whole author situation lives at "AUTHORS" in GitLab::API::v4. go say hi π
β LICENSE β
and the legal tea is at "LICENSE" in GitLab::API::v4. read it, it's your civic duty π§
okay that's the whole page!! β¨ this was the perl v5.36.0 situation, dated 2023-06-13, and yes the header really does call it GitLab...4::Mock(3pm) β the ellipsis is doing its main character thing π
bye bestie, go write some tests!! π₯π
π¦ where this page comes from
- debian trixie: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgitlab-api-v4-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms