# File test/test_SetupDocument.rb, line 10
    def setup
      # for WPM::Driver class
      @driver_call = 0
      @params_call = 0
      @redirect_call = 0
      @redirect_last_page_name = nil
      @redirect_last_query_params = nil

      # for Rucy::DocumentFactory class
      @factory = Rucy::DocumentFactory.new
      page = Object.new
      def page.doc_name
        'Page'
      end
      def page.doc_args
        [ [ 'content', :text, nil ],
          [ 'content-type', :string, 'text/html' ]
        ]
      end
      @factory.add_document(page)
      local = Object.new
      def local.doc_name
        'LocalFile'
      end
      def local.doc_args
        [ [ 'local path', :string, nil ] ]
      end
      @factory.add_document(local)
      test_args = Object.new
      def test_args.doc_name
        'TestArguments'
      end
      def test_args.doc_args
        [ [ 'string', :string, nil ],
          [ 'text',   :text,   nil ],
          [ 'number', :number, nil ],
          [ 'bool',   :bool,   false ],
          [ 'select', :select, %[ foo bar baz ] ],
          [ 'checkset', :checkset, [
              [ 'foo', false ],
              [ 'bar', false ],
              [ 'baz', false ]
            ]
          ],
          [ 'radio', :radio, %[ foo bar baz ] ]
        ]
      end
      @factory.add_document(test_args)
      @doc_args_call = 0
      @doc_args_last_name = nil

      # for Rucy::Control class
      @modified_count_call = 0
      @set_modified_count_call = 0
      @set_modified_count_value = nil
      @document_list = [
        { 'document' => 'Page',
          'arguments' => [
            "Hello world.\n",
            'text/plain'
          ],
          'mount_path' => '/hello',
          'mount_mask' => nil,
          'virtual_host' => nil,
          'comment' => 'test of Page'
        },
        { 'document' => 'LocalFile',
          'arguments' => [
            '/home/alice/public_html'
          ],
          'mount_path' => '/~alice',
          'mount_mask' => nil,
          'virtual_host' => 'foo',
          'comment' => 'test of LocalFile'
        },
        { 'document' => 'TestArguments',
          'arguments' => [
            'test_string',     # string
            'test_text',       # text
            0,                 # number
            true,              # bool
            'bar',             # select
            { 'foo' => true,   # checkset
              'bar' => false,
              'baz' => false
            },
            'baz'              # radio
          ],
          'mount_path' => '/args',
          'mount_mask' => nil,
          'virtual_host' => nil,
          'comment' => 'test of Arguments'
        }
      ]
      @documents_call = 0
      @set_documents_call = 0

      # setup WPM::PageContext class
      loader = WPM::Loader.new('../control/SetupDocument/SetupDocument.rb')
      @SetupDocument = loader.const_get('SetupDocument').new(self, { :control => self, :factory => self })
      assert((@SetupDocument.is_a? WPM::PageContext))
      @SetupDocument.init_context
    end