Very cool stuff. The rake task hangs periodically for me but I'll
probably sort that out after I install Leopard (whenever that is :).
Question on the BDD stuff. Where do you wrap that in the test page?
Is it along these lines?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>JavaScript unit test file</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="assets/prototype.js" type="text/javascript"></script>
<script src="assets/unittest.js" type="text/javascript"></script>
<script src="../../public/javascripts/application.js" type="text/
javascript"></script>
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
</head>
<body>
<div id="content">
<div id="header">
<h1>JavaScript unit test file</h1>
<p>
This file tests <strong>tag.js</strong>.
</p>
</div>
<!-- Log output -->
<div id="testlog"> </div>
</div>
<script type="text/javascript">
// <![CDATA[
new Test.Unit.Runner({
setup: function() {
},
teardown: function() {
},
testEnclosingTag: function() { with(this) {
assertEqual(new Tag('b', 'this is a test'), '[b]this is a test
[/b]');
}}
}, "testlog");
Test.context('Tag class testing', {
'should create a simple tag': function(){
// Should I be extending Tag with Test.BDDMethods here?
// Where do setup (before) and teardown (after) blocks go?
tag = new Tag('b', 'this is a test');
tag.shouldEqual('[b]');
}
});
// ]]>
</script>
</body>
</html>
On Nov 21, 2007, at 12:14 PM, Thomas Fuchs wrote:
>
> That message regards simulated DOM events, which just aren't possible
> in all browsers; regardless of what unit testing framework you use
> (some pending patches will expand the scope of this), so don't fear.
>
> We're currently working on expanding and streamlining the unit testing
> framework used in Prototype, and it does some tricks already, like
> automatic testing in all installed browsers.
>
> You may want to check out:
>
> http://prototypejs.org/contribute (scroll down to "the importance of
> testing").
>
> Plus my presentation on the framework:
>
> http://mir.aculo.us/2006/9/16/adventures-in-javascript-testing
>
> Best,
> Thomas
>
> Am 21.11.2007 um 20:21 schrieb s.ross:
>
>>
>> What are people using for testing Prototype/script.aculo.us code?
>> I've been using jsUnit, and it does work, but I'd prefer to stay with
>> the mainstream on this... I know Script.aculo.us has a unit test
>> framework, but the only info I could find on it (http://
>> wiki.script.aculo.us/scriptaculous/show/UnitTesting) issues the
>> caveat:
>>
>> "...some of the tests will fails in browsers other than Firefox..."
>>
>> One of the appealing parts of jsUnit is that I can run tests in
>> Firefox, Safari and IE, verifying that things behave pretty much as I
>> expect. What are others doing for tests?
>>
>> Thx
>>
>>>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---