Test::...:Result(3pm)

πŸ“¦
version 2.04 Β· 2 versions
  • 2.04 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 2.04 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Test::DatabaseRow::Result ✨

okay bestie, so this page is all about Test::DatabaseRow::Result β€” the little cutie that represents the result of some db testing. iykyk. it's giving "i did a test, here's what happened, now let's tell everybody" πŸ’…


🌸 SYNOPSIS 🌸

use Test::More tests => 1;
use Test::DatabaseRow::Result;

      # create a test results
my $result_object = Test::DatabaseRow::Result->new(
      is_error => 1,
      diag => [ "The WHAM overheaded!" ]
      );

# have those results render to Test::Builder
$result_object->pass_to_test_builder("fire main gun");

no cap, that's the whole vibe. you build the result object, you hand it off to Test::Builder, and it does its little thing πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so this module is used by Test::DatabaseRow::Object to represent the result of a test. that's literally it, that's the job. it holds the tea, it reports the tea β˜•βœ¨

πŸ’– Accessors πŸ’–

these are the read only accessors of the object. they may be (optionally) set at object creation time by passing their name and value to the constructor. so like, constructor time is your one shot at setting them β€” after that they're just read-only icons πŸ‘‘

each accessor may be queried by prefixing its name with the has_ to determine (yes bestie, the original sentence just kinda trails off there, we're keeping it fr fr) πŸ™ˆ

  • is_error β€” a Boolean representing if this is an error or not. true = something went sideways πŸ’€, false = we ate πŸ”₯
  • diag β€” an arrayref containing diagnostic error strings that can help explain any error. like, the receipts for why it broke πŸ“

🌈 Methods 🌈

  • new(...) β€” simple constructor. passing arguments to the constructor sets the values of the accessors. lowkey the easiest thing you'll do all day 🫢
  • add_diag( @diagnostics ) β€” adds extra diagnostics to the diag array. more context, more clarity, we love to see it ✨
  • pass_to_test_builder( $description ) β€” causes this test to render itself out using Test::Builder. it's the moment your result object gets its main character energy on stage 🎀
  • is_success β€” returns true if and only if is_error is false. that's the whole contract, no notes πŸ’―

😭 BUGS 😭

bugs (and requests for new features) can be reported through the CPAN RT system:

<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-DatabaseRow>

alternatively, you can simply fork this project on github and send me pull requests. please see:

<http://github.com/2shortplanks/Test-DatabaseRow>

not me telling you to fork it and slide into the PRs, but like... yes exactly that 🌸

πŸ‘‘ AUTHOR πŸ‘‘

written by Mark Fowler mark@twoshortplanks.com πŸ’œ

copyright Mark Fowler 2011.

this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. (free as in slay πŸ•ŠοΈ)


🌟 SEE ALSO 🌟

Test::DatabaseRow::Object, Test::DatabaseRow, Test::Builder, DBI


and that's the page bestie!! πŸŽ€ this came from the perl v5.34.0 docs, dated 2022-06-17, and honestly? iconic of it. go forth and test those databases, you absolute legend πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from