Class: ODDB::TestImageLink

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_model/text.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



19
20
21
# File 'test/test_model/text.rb', line 19

def setup
  @link = ODDB::Text::ImageLink.new
end

- (Object) test_attributes



27
28
29
30
31
32
33
# File 'test/test_model/text.rb', line 27

def test_attributes
  @link.src = '/foo/bar.gif'  
  expected = {
    'src' => '/foo/bar.gif' 
  }
  assert_equal(expected, @link.attributes)
end

- (Object) test_empty



22
23
24
25
26
# File 'test/test_model/text.rb', line 22

def test_empty
  assert_equal(true, @link.empty?)
  @link.src = '/foo/bar.gif'  
  assert_equal(false, @link.empty?)
end

- (Object) test_gsub



34
35
36
37
38
# File 'test/test_model/text.rb', line 34

def test_gsub
  @link.src = 'some url'
  @link.gsub!(/[aeiou]/) do |match| match.upcase end
  assert_equal 'sOmE Url', @link.src
end

- (Object) test_preformatted



39
40
41
# File 'test/test_model/text.rb', line 39

def test_preformatted
  assert_equal true, @link.preformatted?
end

- (Object) test_to_s



42
43
44
# File 'test/test_model/text.rb', line 42

def test_to_s
  assert_equal '(image)', @link.to_s
end