Skip to content

Test2::Mock - call_tracking() does not work on objects created via mock_obj() #1074

Description

@PopeFelix

When an anonymous object is created using mock_obj() and call tracking is enabled, the method call_tracking() called on the created object returns undef.

Steps to reproduce:

#!/usr/bin/env perl

use strict;
use warnings;
use Test2::Tools::Mock qw/mock_obj/;
use Data::Dumper;

my $mock = mock_obj( track => 1, add => [ do => 1 ] );
$mock->do('something');
my $track = $mock->call_tracking;
print Dumper $track; # $track is undef

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions