Skip to content

Instantly share code, notes, and snippets.

@bigtiger
Created June 30, 2009 20:56
Show Gist options
  • Save bigtiger/138421 to your computer and use it in GitHub Desktop.
Save bigtiger/138421 to your computer and use it in GitHub Desktop.
Module.class_eval do
def temporal_const(name, value)
const_set(name, value)
yield
remove_const(name)
end
end
in use ...
context "#base_uri" do
it "builds a URI:HTTP with a port" do
MailerHelper.temporal_const 'HOST', "localhost:3000" do
helper.send(:base_uri).to_s.should == "http://localhost:3000"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment