Don't capture 'Hive' if it exists in aerohive AP model name
This commit is contained in:
@@ -106,7 +106,7 @@ sub model {
|
||||
my $aerohive = shift;
|
||||
my $descr = $aerohive->description();
|
||||
|
||||
if ( $descr =~ m/\b((Hive|)AP\d+)\b/ix ) {
|
||||
if ( $descr =~ m/\b(?:Hive|)(AP\d+)\b/ix ) {
|
||||
return $1;
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -116,11 +116,16 @@ sub os_ver : Tests(3) {
|
||||
is($test->{info}->os_ver(), undef, q(No description returns undef os_ver));
|
||||
}
|
||||
|
||||
sub model : Tests(3) {
|
||||
sub model : Tests(4) {
|
||||
my $test = shift;
|
||||
|
||||
can_ok($test->{info}, 'model');
|
||||
is($test->{info}->model(), 'AP121', q(Model is expected value));
|
||||
is($test->{info}->model(),
|
||||
'AP121', q(Model with 'Hive' in description sting is expected value));
|
||||
|
||||
$test->{info}{_description} = 'AP250, HiveOS 8.3r2 build-191018';
|
||||
is($test->{info}->model(),
|
||||
'AP250', q(Model without 'Hive' in description sting is expected value));
|
||||
|
||||
$test->{info}->clear_cache();
|
||||
is($test->{info}->model(), undef, q(No description returns undef model));
|
||||
|
||||
Reference in New Issue
Block a user