Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/Test/MockFile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,26 @@ sub clear_strict_rules {
return;
}

# Internal API for Test::MockFileSys — not part of the public interface.
# Pushes a pre-built rule hashref onto @STRICT_RULES and returns it.
sub _push_strict_rule {
my ( $class, $rule ) = @_;

ref $rule eq 'HASH'
or croak("_push_strict_rule requires a hashref");

push @STRICT_RULES, $rule;
return $rule;
}

# Internal API for Test::MockFileSys — removes a specific rule ref from @STRICT_RULES.
sub _remove_strict_rule {
my ( $class, $rule ) = @_;

@STRICT_RULES = grep { $_ != $rule } @STRICT_RULES if $rule;
return;
}

=head2 add_strict_rule_for_filename( $file_rule, $action )

Args: ($file_rule, $action)
Expand Down
Loading
Loading