Permalink
Browse files

Merge in tempire's multiple override work

 * update some coding practices from patch
  • Loading branch information...
1 parent 143f8e6 commit 8d713ddc3f9459711f7c3b4aa17f22912da2a809 @exodist committed Feb 16, 2011
Showing with 21 additions and 3 deletions.
  1. +10 −0 lib/Mock/Quick.pm
  2. +11 −3 lib/Mock/Quick/Class.pm
View
@@ -166,6 +166,16 @@ Define a method for an L<Mock::Quick::Object> instance.
Chad Granum L<exodist7@gmail.com>
+=head1 CONTRIBUTORS
+
+Contributors are listed as authors in modules they have touched.
+
+=over 4
+
+=item Glen Hinkle L<glen@empireenterprises.com>
+
+=back
+
=head1 COPYRIGHT
Copyright (C) 2011 Chad Granum
View
@@ -92,7 +92,8 @@ sub override {
my %pairs = @_;
my @originals;
- while( my ( $name, $orig_value ) = each %pairs) {
+ for my $name ( keys %pairs ) {
+ my $orig_value = $pairs{$name};
my $real_value = _is_sub_ref( $orig_value )
? $orig_value
@@ -104,13 +105,14 @@ sub override {
push @originals, $original;
}
+
return @originals;
}
sub restore {
my $self = shift;
- while( my $name = shift @_) {
+ for my $name ( @_ ) {
my $original = $self->{$name};
if ( $original ) {
@@ -217,7 +219,13 @@ Provides class mocking for L<Mock::Quick>
=head1 AUTHORS
-Chad Granum L<exodist7@gmail.com>
+=over 4
+
+=item Chad Granum L<exodist7@gmail.com>
+
+=item Glen Hinkle L<glen@empireenterprises.com>
+
+=back
=head1 COPYRIGHT

0 comments on commit 8d713dd

Please sign in to comment.