def setup
@driver_call = 0
@params_call = 0
@redirect_call = 0
@redirect_last_page_name = nil
@redirect_last_query_params = nil
@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
@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',
'test_text',
0,
true,
'bar',
{ 'foo' => true,
'bar' => false,
'baz' => false
},
'baz'
],
'mount_path' => '/args',
'mount_mask' => nil,
'virtual_host' => nil,
'comment' => 'test of Arguments'
}
]
@documents_call = 0
@set_documents_call = 0
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