def setup
@driver_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)
@doc_args_call = 0
@doc_args_last_name = nil
@doc_names_call = 0
@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'
}
]
@documents_call = 0
@set_documents_call = 0
loader = WPM::Loader.new('../control/MountMap/MountMap.rb')
@MountMap = loader.const_get('MountMap').new(self, { :control => self, :factory => self })
assert((@MountMap.is_a? WPM::PageContext))
@MountMap.init_context
assert_equal(1, @documents_call)
end