Hi,
my Ruby On Rails unit-test fails in a simple string comparison and I can't figure out why.
In the model TestItem
, I have
doc = REXML::Document.new(data)
@bugtitle = doc.root.get_text("/bugzilla/bug/short_desc")
where data is a xml-string returned by a Net::HTTP::post
request. The data looks good, and if I output @bugtitle
it contains the expected string. In my unit-test, I have
test "bugtitle" do
ti = testitems(:one)
assert_equal("different RID folder for gating x-ray correction images",ti.bugtitle)
end
Surprisingly (at least for me) the test fails with the following output (copied verbatim from the shell):
1) Failure:
test_bugtitle(TestTest) [unit/testitem_test.rb:7]:
<"different RID folder for gating x-ray correction images"> expected but was
<"different RID folder for gating x-ray correction images">.
I'm at a loss here as to where this error comes from since the string do look identical to me. For what it's worth, this is with rails 2.3.4 and ruby 1.8.6 on Windows (don't get me started).