Skip to content

Commit

Permalink
Silence method redefinition warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Aug 27, 2011
1 parent 297f028 commit 7eedbc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/monkey_patches.rb
Expand Up @@ -73,7 +73,11 @@ def capture_method_definition(klass, method, original)
end

def realias(klass, method, alias_extension)
klass.class_eval { alias_method method, :"#{method}_#{alias_extension}" }
klass.class_eval do
old_verbose, $VERBOSE = $VERBOSE, nil
alias_method method, :"#{method}_#{alias_extension}"
$VERBOSE = old_verbose
end
end

def realias_all(alias_extension)
Expand Down

0 comments on commit 7eedbc8

Please sign in to comment.