Class: ODDB::View::TestPointerSteps

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_view/pointersteps.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



93
94
95
96
97
# File 'test/test_view/pointersteps.rb', line 93

def setup 
  @model = StubPointerStepsModel.new
  @session = StubPointerStepsSession.new
  @container = StubPointerStepsContainer.new
end

- (Object) test_to_html1



98
99
100
101
102
# File 'test/test_view/pointersteps.rb', line 98

def test_to_html1
  steps = View::PointerSteps.new(@model, @session, @container)
  expected = "<TABLE cellspacing=\"0\">\n<TR>\n<TD class=\"th-pointersteps\">\nTh_pointer_descr\n</TD>\n<TD>\n<A href=\"url\" name=\"backsnap\" class=\"th-pointersteps\">\nBacksnap\n</A>\n</TD>\n<TD>\n\#{View::PointerSteps::STEP_DIVISOR}\n</TD>\n<TD class=\"th-pointersteps\">\nbon\n</TD>\n</TR>\n</TABLE>\n"
  assert_equal(expected, CGI.pretty(steps.to_html(CGI.new)))
end

- (Object) test_to_html2



123
124
125
126
127
128
# File 'test/test_view/pointersteps.rb', line 123

def test_to_html2
  @session.state.snapback_model = StubPointerStepsAncestor.new('foo')
  steps = View::PointerSteps.new(@model, @session, @container)
  expected = "<TABLE cellspacing=\"0\">\n<TR>\n<TD class=\"th-pointersteps\">Th_pointer_descr</TD>\n<TD>\n<A href=\"url\" name=\"backsnap\" class=\"th-pointersteps\">Backsnap</A>\n</TD>\n<TD>\#{View::PointerSteps::STEP_DIVISOR}</TD>\n<TD class=\"th-pointersteps\">\n<A name=\"pointer_descr\" href=\"http://www.oddb.org/de/gcc/resolve/pointer-foo-\" class=\"list\">foo</A>\n</TD>\n<TD>\#{View::PointerSteps::STEP_DIVISOR}</TD>\n<TD class=\"th-pointersteps\">bon</TD>\n</TR>\n</TABLE>\n"
  assert_equal(expected.tr("\n", ""), steps.to_html(CGI.new))
end

- (Object) test_to_html3



145
146
147
148
149
150
# File 'test/test_view/pointersteps.rb', line 145

def test_to_html3
  @model.pointer_descr_enable = false
  steps = View::PointerSteps.new(@model, @session, @container)
  expected = "<TABLE cellspacing=\"0\">\n<TR>\n<TD class=\"th-pointersteps\">Th_pointer_descr</TD>\n<TD>\n<A href=\"url\" name=\"backsnap\" class=\"th-pointersteps\">Backsnap</A>\n</TD>\n</TR>\n</TABLE>\n"
  assert_equal(expected.tr("\n", ""), steps.to_html(CGI.new))
end