I am having a problem with writing xml file. I am using REXML.
Everything goes fine on IRB, i can add new elements to my existing file,
add atributes or text. When i print my xml in IRB it looks ok. Then i
try xml.write(STDOUT, 0), and i get no errors but the xml does not
change. My persmissions look ok. I am working on windows XP. Any clue?
Stop using IRB and start using unit tests. You should write a little bit
of
a test case and ‘p’ a result, then run ‘rake recent’ and read your
console.
If the result is correct, write an assertion that locks it in and
repeat.
Small experiments with test cases will replace small experiments with
IRB,
and will preserve a history of correct results. This is how RoR itself
was
created, and it’s a major reason RoR is so powerful.
thanks for the information! i really need to start using tests then, but
first i will read a little about them.
I am having a problem with writing xml file. I am using REXML.
Everything goes fine on IRB,
Stop using IRB and start using unit tests. You should write a little bit
of
a test case and ‘p’ a result, then run ‘rake recent’ and read your
console.
If the result is correct, write an assertion that locks it in and
repeat.
Small experiments with test cases will replace small experiments with
IRB,
and will preserve a history of correct results. This is how RoR itself
was
created, and it’s a major reason RoR is so powerful.
i can add new elements to my existing file,
add atributes or text. When i print my xml in IRB it looks ok. Then i
try xml.write(STDOUT, 0), and i get no errors but the xml does not
change. My persmissions look ok. I am working on windows XP. Any clue?
STDOUT is your console’s handle as a file stream. It’s not a real file.
Try
this:
I am having a problem with writing xml file. I am using REXML.
Everything goes fine on IRB,
Stop using IRB and start using unit tests.
Well… the world is a big place, and there’s room for lots of things I agree with James Duncan Davidson that the Rails application
console is a great debugging tool, and I’d say the same about irb in
general. So are unit tests, of course