[jQuery] .ready(), Rhino and HttpUnit
Hi all,
I'm creating a Web app which uses jQuery, and am unit testing it with HttpUnit which uses Rhino (the Mozilla JavaScript implementation).
I'm having trouble with <span style="font-family: courier new,monospace;">
$(document).ready(...)</span> causing the tests to crash with this message:
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><span style="font-family: courier new,monospace;">
alert("hi");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">});' failed: TypeError: undefined is not a function. (httpunit; line 1456))</span></blockquote>
<div>
The whole statement is this:
</div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><span style="font-family: courier new,monospace;">
$(document).ready(function() {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> alert("hi");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
});</span>
</blockquote>
Other basic checks are ok, e.g. <span style="font-family: courier new,monospace;">$("#foo").focus()</span> works perfectly.
Even if I only try to use .ready() after checking that is is defined, I still get the same result:
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><span style="font-family: courier new,monospace;">if (typeof $(document).ready === 'function')
</span>
</blockquote>
I know this is likely to be a Rhino/HttpUnit problem but as I know several people on this list are familiar with Rhino I wanted to know if anyone's seen this or has any ideas?
I'm on:
jQuery 1.1.4
HttpUnit 1.6.2
TIA,
--rob
--
Rob Desbois
Eml: <a href="mailto:rob.desbois@gmail.com">rob.desbois@gmail.com</a>