# Advice needed on testing strategy

**URL:** <https://www.ruby-forum.com/t/advice-needed-on-testing-strategy/142400>\
**Category:** Ruby\
**Created:** [July 7, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/advice-needed-on-testing-strategy/142400 "2008-07-07T15:48:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [July 7, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/advice-needed-on-testing-strategy/142400/1 "2008-07-07T15:48:30Z")

</div>

Greetings!

I’m working on a library that wraps REXML processing of a specific XML  
format (CCR - Continuity of Care Record). The objective is to process  
the XML so that the developer doesn’t have to. So, for example, I can  
do…

ccr = RubyCCR::Document.open(‘demo.xml’) #open file / read the XML into  
a set of objects  
ccr.actors.each do |this\_actor|  
@first\_name = this\_actor.current\_name.family  
@last\_name = this\_actor.current\_name.family  
end

From a testing perspective, my objective is to make sure that all the  
content in the XML file actually ends up in the appropriate objects /  
attributes. Right now I’m loading specific XML files per testcase /  
test and hardcoding the expected values in my unit tests based on  
knowing what’s in the XML file being loaded. This seems wrong. If  
anybody’s got a better idea, I’d sure appreciate hearing it.

Thanks,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [July 8, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/advice-needed-on-testing-strategy/142400/2 "2008-07-08T13:20:53Z")

</div>

Make your wrapping capable of operating from a string.  
Then your test XML and results are all in the same place
