A
aidy
Hello,
I my script I have a method call
class ST_LTD_1 < Test::Unit::TestCase
def test_st_ltd_1
xml_logger(self.class, string_to_search)
end
end
this is the invoked method
def xml_logger (test_id, vp_text)
doc = Document.new
xmldecl = XMLDecl.default
doc.add(xmldecl)
test_result = doc.add_element 'testresults'
test_id = test_result.add_element 'testID'
test_id.text = test_id
if verify_result_1(vp_text) then
pass = test_id.add_element 'pass'
pass.text = 'PASS'
else
pass = test_id.add_element 'fail'
pass.text = 'FAIL!'
end
doc.write($stdout, 1)
end
this is the line of code where the calling class name should be passed
to an XML node
test_id.text = test_id
However the XML produced is this
<testresults>
<testID><testID/><pass>PASS</pass>
</testID>
</testresults>
and I am not sure so why?
Thanks for the help
Aidy
I my script I have a method call
class ST_LTD_1 < Test::Unit::TestCase
def test_st_ltd_1
xml_logger(self.class, string_to_search)
end
end
this is the invoked method
def xml_logger (test_id, vp_text)
doc = Document.new
xmldecl = XMLDecl.default
doc.add(xmldecl)
test_result = doc.add_element 'testresults'
test_id = test_result.add_element 'testID'
test_id.text = test_id
if verify_result_1(vp_text) then
pass = test_id.add_element 'pass'
pass.text = 'PASS'
else
pass = test_id.add_element 'fail'
pass.text = 'FAIL!'
end
doc.write($stdout, 1)
end
this is the line of code where the calling class name should be passed
to an XML node
test_id.text = test_id
However the XML produced is this
<testresults>
<testID><testID/><pass>PASS</pass>
</testID>
</testresults>
and I am not sure so why?
Thanks for the help
Aidy