Skip to content

Commit

Permalink
Issue teodesian#335: Use $method for the generic test name,
Browse files Browse the repository at this point in the history
as $method is no longer changed in the sub.
Slightly nicer formatting of the generic test name.
  • Loading branch information
bschmalhofer authored and KohaAloha committed Sep 29, 2022
1 parent 1bd26bc commit f3cb48e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/Test/Selenium/Remote/Role/DoesTesting.pm
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,16 @@ sub _check_ok {
}
};

my $default_test_name = $method;
$default_test_name .= "'" . join( "' ", @r_args ) . "'"
if $num_of_args > 0;

my $test_name = pop @args // $default_test_name;
# test description might have been explicitly passed
my $test_name = pop @args;

# generic test description when no explicit test description was passed
if ( ! defined $test_name ) {
$test_name = $num_of_args > 0 ?
join( ' ', $method, map { q{'$_'} } @r_args )
:
$method;
}

# case when find_no_element found an element, we should croak
if ( $method eq 'find_no_element' ) {
Expand Down

0 comments on commit f3cb48e

Please sign in to comment.