get_ok('/')->status_is(200)
The short and simple answer is that the method call both changes the
object and returns the changed object.
# Test if the HTML login form exists
get_ok('/')->status_is(200)
->element_exists('form input[name="user"]')
->element_exists('form input[name="pass"]')
->element_exists('form input[type="submit"]');
On Mon, 30 Nov 2020 19:16:18 +0000, hymie! wrote:
The short and simple answer is that the method call both changes the
object and returns the changed object.
Ah! I see. So the returned object is of the same class (indeed, it's
the same object) and has the same methods, which can be called again and again. Clever!
"Henry" == Henry Law <news@lawshouse.org> writes:
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
Rainer> Well, "sort-of". This kind of chaining is very bad if one ever needs to
Rainer> debug this code: The substatements making up this complex statement are
Rainer> neither breakable nor is it possible to insert code between them without
Rainer> breaking up the expression first.
I use them extensively in my File::Finder. Then again, I don't debug
much. :)
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
Rainer> I don't see any examples in
Rainer> https://metacpan.org/source/MERLYN/File-Finder-0.53/lib%2FFile%2FFinder.pm
at the very bottom: "show 202 lines of pod". You must've noot clicked
that. How long have you been using metacpan? :)
at the very bottom: "show 202 lines of pod". You must've noot clicked"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
that. How long have you been using metacpan? :)
at the very bottom: "show 202 lines of pod". You must've noot clicked"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
that. How long have you been using metacpan? :)
Rainer> There's no code in the documentation.
Wow. You're blinded, or something. Take a look at the formatted
version:
https://metacpan.org/pod/File::Finder
I see about 50 lines of code.
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
Rainer> There's no example of expression chaining in there either."Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
## -depth and -follow are noted, but need a bit of help for find:
my $deep_dirs = File::Finder->depth->type('d')->ls->exec('rmdir','{}'); find($deep_dirs->as_options, @places);
my $files_depth_print = $files->depth->print;
my $big_or_old_files =
$files->left->size("+50")->or->atime("+30")->right;
Truly, Rainer, I sincerely doubt your ability to read a perldoc page
now. {sigh}
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
Rainer> I wasn't particularly interested in the contents as I still had expected
Rainer> to find this in the code.
Find *what* in the code?
"Rainer" == Rainer Weikusat <rweikusat@talktalk.net> writes:
Find *what* in the code?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 79:17:41 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,333,083 |
Posted today: | 1 |