org.jruby.test
Class TestRubyHash

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jruby.test.TestRubyBase
              extended by org.jruby.test.TestRubyHash
All Implemented Interfaces:
junit.framework.Test

public class TestRubyHash
extends TestRubyBase

Author:
chadfowler

Field Summary
 
Fields inherited from class org.jruby.test.TestRubyBase
runtime
 
Constructor Summary
TestRubyHash(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
 void testConstructors()
          Test literal constructor {}, Hash::[], and Hash::new with and without the optional default-value argument.
 void testConversions()
          Hash#to_s, Hash#to_a, Hash#to_hash
 void testDefault()
          Hash#default, Hash#default=
 void testDeleting()
          Hash#delete, Hash#delete_if, Hash#reject, Hash#reject!
 void testIterating()
          Hash#each, Hash#each_pair, Hash#each_value, Hash#each_key
 void testLookups()
          Test Hash#[]= (store) and Hash#[] (retrieve).
 void testRestructuring()
          Hash#sort, Hash#invert
 void testSizeRelated()
          Hash#size, Hash#length, Hash#empty?
 
Methods inherited from class org.jruby.test.TestRubyBase
eval, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestRubyHash

public TestRubyHash(java.lang.String name)
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

testConstructors

public void testConstructors()
                      throws java.lang.Exception
Test literal constructor {}, Hash::[], and Hash::new with and without the optional default-value argument.

Throws:
java.lang.Exception

testLookups

public void testLookups()
                 throws java.lang.Exception
Test Hash#[]= (store) and Hash#[] (retrieve). Also test whether Object#== is properly defined for each class.

Throws:
java.lang.Exception

testConversions

public void testConversions()
                     throws java.lang.Exception
Hash#to_s, Hash#to_a, Hash#to_hash

Throws:
java.lang.Exception

testSizeRelated

public void testSizeRelated()
                     throws java.lang.Exception
Hash#size, Hash#length, Hash#empty?

Throws:
java.lang.Exception

testIterating

public void testIterating()
                   throws java.lang.Exception
Hash#each, Hash#each_pair, Hash#each_value, Hash#each_key

Throws:
java.lang.Exception

testDeleting

public void testDeleting()
                  throws java.lang.Exception
Hash#delete, Hash#delete_if, Hash#reject, Hash#reject!

Throws:
java.lang.Exception

testDefault

public void testDefault()
                 throws java.lang.Exception
Hash#default, Hash#default=

Throws:
java.lang.Exception

testRestructuring

public void testRestructuring()
                       throws java.lang.Exception
Hash#sort, Hash#invert

Throws:
java.lang.Exception


Copyright © 2002-2007 JRuby Team. All Rights Reserved.