Skip to content

Instantly share code, notes, and snippets.

@brettfishman
Created June 19, 2012 21:22
Show Gist options
  • Save brettfishman/2956617 to your computer and use it in GitHub Desktop.
Save brettfishman/2956617 to your computer and use it in GitHub Desktop.
Prevent "already initialized constant" warnings when running specs
quietly do
SomeModuleOrClass.send(:remove_const, :SOME_CONSTANT)
SomeModuleOrClass.send(:const_set, :SOME_CONSTANT, "new constant value")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment