Class: TestHtmlLinkHandler

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_util/html_parser.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



231
232
233
# File 'test/test_util/html_parser.rb', line 231

def setup
  @handler = ODDB::HtmlLinkHandler.new([])
end

- (Object) test_attribute



240
241
242
243
# File 'test/test_util/html_parser.rb', line 240

def test_attribute
  @handler.attributes = {'arb', 'crd'}
  assert_equal('crd', @handler.attribute('ARb'))
end

- (Object) test_initialize



234
235
236
237
238
239
# File 'test/test_util/html_parser.rb', line 234

def test_initialize
  attrs = [['foo', '"bar"'], ['bAz', "'urgl'"]]
  handler =  ODDB::HtmlLinkHandler.new(attrs)
  assert_equal('bar', handler.attribute('foo'))
  assert_equal('urgl', handler.attribute('baz'))
end

- (Object) test_send_adata



244
245
246
247
# File 'test/test_util/html_parser.rb', line 244

def test_send_adata
  value = " link"
  assert_equal('link', @handler.send_adata(value))
end