Skip to content
Browse files

Silence warning by removing the constant first before redefining it.

  • Loading branch information...
1 parent 9946837 commit 5207080eac7287dc4eba592a6811b035a88d9247 @sikachu sikachu committed
Showing with 1 addition and 0 deletions.
  1. +1 −0 spec/spec_helper.rb
View
1 spec/spec_helper.rb
@@ -50,6 +50,7 @@ def self.included(example_group)
def define_class(path, base = Object, &block)
namespace, class_name = *constant_path(path)
klass = Class.new(base)
+ namespace.send(:remove_const, class_name) if namespace.const_defined?(class_name)
namespace.const_set(class_name, klass)
klass.class_eval(&block) if block_given?
@defined_constants << path

0 comments on commit 5207080

Please sign in to comment.
Something went wrong with that request. Please try again.