def test_get
assert_nil(@@ns.get("Santa Claus"),
"If a key is not set, Namespace#get returns nil")
@@ns.set("Santa Claus", "Kris Kringle")
assert_equal("Kris Kringle", @@ns.get("Santa Claus"),
"Use Namespace#get to access to Namespace value")
assert_equal(nil, @@ns.get("occupation"))
p = PageTemplate::Namespace.new()
p["occupation"] = "Foole"
@@ns.parent = p
assert_equal("Foole", @@ns.get("occupation"),
"Namespace#get will search parent Namespaces if they are available")
assert_equal(nil, @@ns.get("abs"))
@@ns.object = -5
assert_equal(5, @@ns.get("abs"),
"Namespace#get will send get requests to a contained object if it is available")
assert_equal(3,@@ns.get("succ.succ.abs"),
"Namespace#get will send get requests subsequently to accessors if available")
@@ns.set("list", ['one','two','three'])
assert_equal('two',@@ns.get('list.1'),
"If an accessor looks like an integer, it's an array index")
@@ns.set('fruits',{'a'=>'apple','b'=>'banana'})
assert_equal('banana',@@ns.get('fruits.b'),
"If an object has_key?(b), it checks get object['b'] rather than send(:b)")
@@ns.set(:title, "xyz")
assert_equal("xyz", @@ns.get("title"),
"Symbols may be used as Namespace keys")
end