def setup
@driver_call = 0
@redirect_call = 0
@redirect_last_page_name = nil
@redirect_last_query_params = nil
@factory = Rucy::DocumentFactory.new
erb = Object.new
def erb.filter_name
'eRuby'
end
def erb.filter_args
[ [ 'safe level', :number, 1 ] ]
end
@factory.add_filter(erb)
ssi = Object.new
def ssi.filter_name
'SSI'
end
def ssi.filter_args
[ [ 'SSI commands', :checkset,
[ [ 'config', true ],
[ 'include', true ],
[ 'echo', true ],
[ 'fsize', true ],
[ 'flastmod', true ],
[ 'exec', true ]
]
]
]
end
@factory.add_filter(ssi)
@filter_args_call = 0
@filter_names_call = 0
@modified_count_call = 0
@set_modified_count_call = 0
@set_modified_count_value = nil
@filter_list = [
{ 'filter' => 'eRuby',
'arguments' => [ 1 ],
'attach_path' => '/eRuby',
'attach_mask' => %/\.rhtml?/,
'virtual_host' => nil,
'comment' => 'test of eRuby'
},
{ 'filter' => 'SSI',
'arguments' => [
{ 'config' => true,
'include' => true,
'echo' => true,
'fsize' => true,
'flastmod' => true,
'exec' => false
}
],
'attach_path' => '/~alice',
'attach_mask' => %/\.shtml?/,
'virtual_host' => 'foo',
'comment' => 'test of SSI'
}
]
@filters_call = 0
@set_filters_call = 0
loader = WPM::Loader.new('../control/FilterMap/FilterMap.rb')
@FilterMap = loader.const_get('FilterMap').new(self, { :control => self, :factory => self })
assert((@FilterMap.is_a? WPM::PageContext))
@FilterMap.init_context
assert_equal(1, @filters_call)
end