Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add remove method

  • Loading branch information...
commit f93fb24b9b077e44e2d383de796fbf4b3a97231a 1 parent 42d6b3d
@nekokak authored
Showing with 23 additions and 0 deletions.
  1. +6 −0 lib/Kamui/Container.pm
  2. +17 −0 t/010_container/remove.t
View
6 lib/Kamui/Container.pm
@@ -165,5 +165,11 @@ sub get {
$obj;
}
+sub remove {
+ my ($self, $class) = @_;
+ $self = $self->instance unless ref $self;
+ delete $self->{_inflated_classes}->{$class};
+}
+
1;
View
17 t/010_container/remove.t
@@ -0,0 +1,17 @@
+use t::Utils;
+use Mock::Container;
+use Test::More;
+use Data::Dumper;
+
+subtest 'remove' => sub {
+ my $foo = container('foo');
+ Mock::Container->remove('foo');
+ my $foo2 = container('foo');
+
+ isnt $foo, $foo2;
+
+ done_testing;
+};
+
+done_testing;
+
Please sign in to comment.
Something went wrong with that request. Please try again.