Hello,

In message "[ruby-talk:04504] Re: RubyUnit and encapsulation."
    on 00/08/18, Dave Thomas <Dave / thomases.com> writes:

> 1. Produce a subclass of your main class with accessors for the
>    internal state and private functions (remember, you can override
>    scope in a subclass in Ruby).

FYI, RubyUnit includes ToPublic module. ToPublic#to_public method
creates a subclass of your class which all methods are public 
methods.
For example,

  class MyClass
    def my_private_method
      ...
    end
    private :my_private_method
  end

  class TestMyClass < RUNIT::TestCase
    include ToPublic
    def setup
      @aMyClass = to_public(MyClass).new
    end
    def test_my_private_method
      # you can access private_method
      assert(@aMyClass.my_private_method)
    end
  end

  Thank you,
  Masaki Suketa <CQN02273 / nifty.ne.jp>