In Ruby, I want to store some stuff in a Hash, but I don\'t want it to be case-sensitive. So for example:
h = Hash.new h[\"HELLO\"] = 7 puts h[\"hello\"]
require 'test/unit' class TestCaseIndifferentHash < Test::Unit::TestCase def test_that_the_hash_matches_keys_case_indifferent def (hsh = {}).[](key) super(key.upcase) end hsh['HELLO'] = 7 assert_equal 7, hsh['hello'] end end