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