Scal v0.2 Released

0 views
Skip to first unread message

jamiegrove

unread,
Nov 20, 2007, 8:30:50 PM11/20/07
to Ruby on Rails: Spinoffs
Version 0.2 of scal (javascript calendar based on prototype) is now
available for "general release".

This version is the result of many coding hours by Ian Tyndall along
with
contributions from Andrew Reutter and others in the community.

In addition to the new release, Scal now has a new project home:

http://scal.fieldguidetoprogrammers.com

Thanks to everyone who contributed to this released, especially Ian
(who did the lion's share of the work)!


Best regards,

- Jamie
http://www.fieldguidetoprogrammers.com

s.ross

unread,
Nov 21, 2007, 2:21:34 PM11/21/07
to rubyonrail...@googlegroups.com
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

Thomas Fuchs

unread,
Nov 21, 2007, 3:14:13 PM11/21/07
to rubyonrail...@googlegroups.com
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

s.ross

unread,
Nov 21, 2007, 8:50:38 PM11/21/07
to rubyonrail...@googlegroups.com
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>

s.ross

unread,
Nov 21, 2007, 11:18:52 PM11/21/07
to rubyonrail...@googlegroups.com
Thanks for the pointers. I love the BDD stuff and have pretty much
stopped using Test::Unit for my Ruby stuff. I'm unclear how to
integrate it into a test page. I put a pastie (http://pastie.caboo.se/
120763) out that should explain my questions better, but
fundamentally, my questions are:

- Does the BDD stuff go inside the Test.Unit.Runner arguments, as
normal test cases do?
- Is there something analogous to before/after blocks in rSpec (I
know there is setup and teardown ... just wondered if there was more)?
- Do you have a spec that you'd like to put someplace public so I can
answer my own questions :-)

Thanks,

Steve


On Nov 21, 2007, at 12:14 PM, Thomas Fuchs wrote:

Reply all
Reply to author
Forward
0 new messages