Test::Magpie::Stub(3)

πŸ“¦ version 0.11, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

Test::Magpie::Stub β€” The declaration of a stubbed method ✨

This is the Test::Magpie::Stub(3) page, bestie: User Contributed Perl Documentation, and it's literally all about stubs πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this represents a stub method β€” a method that may have some sort of action when called. Stub methods are created by invoking the method name (with a set of possible argument matchers/arguments) on the object returned by when in Test::Magpie. Slay πŸ’…

Stub methods have a stack of executions. Every time the stub method is called (matching arguments), the next execution is taken from the front of the queue and called. As stubs are matched via arguments, you may have multiple stubs for the same method name. Iconic behavior, honestly 🌈


🌸 ATTRIBUTES 🌸

  • executions β€” Internal. An array reference containing all stub executions. Lowkey just the whole execution pile, bestie 🫢

✨ METHODS ✨

then_return $return_value

Pushes a stub method that will return $return_value to the end of the execution queue. It's giving "next time, return this" energy πŸ’–

then_die $exception

Pushes a stub method that will throw $exception when called to the end of the execution stack. Dramatic? Yes. Effective? Also yes 😭

execute

Internal. Executes the next execution, if possible. Main character energy: it steps up and does the next thing when it can πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

  • Oliver Charles <oliver.g.charles@googlemail.com> πŸ’œ
  • Steven Lee <stevenwh.lee@gmail.com> πŸ¦‹

This software is copyright (c) 2013 by Oliver Charles.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Fr fr, free software rights preserved 🌈


Signing off with perl v5.42.0, dated 2020-11-24 β€” that's the source/version and date, bestie, and we ate πŸ’…βœ¨

πŸ“¦ where this page comes from