Wednesday, October 29th, 2008

MooTools Round-up: Call for Plug-ins, Testing Framework, and “Clientcide”

Category: MooTools

<p>Aaron Newton wrote in with a few interesting news items related to the MooTools community.

Clientcide Testing Framework

First, on the new stand-alone site (formerly recently released the Clientcide Test Framework (aka the MooTools Unit Test Framework):

MooTools ships with a version of JSSpec ( and a series of Specs tests. This test framework is excellent at verifying that code that immediately produces an output is working. It can test, for example, that 2+2 does equal 4.

It is not, however, very good at evaluating any type of code that has a delay between the execution of a code block and the production of a result. This includes Ajax requests, animations and other transitions, or interfaces that require a user to interact with the test (such as Drag).

The MooTools Unit Test Framework aims to create an environment where developers can utilize test driven development patterns to develop their code as well as use those tests to regress their changes. Tests are easy to write and easy to verify by non-coders. Users are given a simple task (“Drag the box around”) and a question to answer (“Can you drag it around?”). Answering yes marks the test as having passed. Answering no marks it as having failed.

Each test is configured thusly:

< view plain text >
  1. {
  2.     tests: [
  3.         {
  4.             title: "Your Test Title",
  5.             description: "A brief description of this test.",
  6.             verify: "Verification question to ask the user - did the test work?",
  7.             before: function(){
  8.                 //code to execute when the user starts the test
  9.             },
  10.             body: "//User editable JavaScript run after *before* and before *post*",
  11.             post: function(){
  12.                 //code to execute immediately after the *before* test above;
  13.                 //if this returns a "falsy" value, the test will fail immediately
  14.                 //before the user does anything else
  15.             }
  16.         }
  17.     ],
  18.     otherScripts: ["SomeOtherFileToLoad"]
  19. }

Clientcide Plug-in Repository

While MooTools lacks a formal plug-in community, Aaron is also announcing that the Clientcide website will fulfill that need on a temporary basis and as part of that makes a call for plug-ins and releases his own batch of plug-ins:

As many of you know, the MooTools team is hard at work on a plugin repository that will allow developers to share their date pickers, form validators, effects, and other widgets with anyone. This project is being pursued as fast as possible, but this means it’s up to a few people who are burning their spare time to work on it as they can.

As a stop-gap solution, I’m going to open up the Clientcide repositories now that I’ve thrown off my corporate bonds. Anyone that wants to release a plugin here is welcome to do so. They’ll be included as additional download options on the Clientcide builder page.

Starting today I’m going to start releasing my work as I write it. This is still somewhat infrequent – the majority of the code I write are classes for my own projects that would be of little use to anyone else. But instead of letting them pile up, I’m going to just drop them all in a “Beta” directory in my repository and get them onto the download page.

Today I released 9 scripts:

* DollarE – Brings back $E from MooTools 1.11. Returns a single Element for a selector.
* DollarG – Returns a collection when given an element, a collection of elements, an element id, or a selector.
* Hash.Run – Executes every method in a hash. Used for page init function groups.
* HoverGroup – Manages mousing in and out of multiple objects (think drop-down menus).
* InputFocus – Adds a ‘focused’ class to inputs when they have focus.
* MenuSlider – A simple dropdown class; see the menu at the top of
* Occlude – Mixin class for preventing a class from applying itself to the same element twice.
* String.FindAllEmails – Finds all the email addresses in a string.
* ToElement – Mixin class that returns *this.element*. Allows you to do $(myInstance).

Posted by Ben Galbraith at 10:13 am

3.2 rating from 28 votes


Comments feed TrackBack URI

Hmm, when I think of “clientcide”, I think of killing my clients.

Comment by MattCoz — October 29, 2008

Well yeah, there’s that too. I choose not to highlight that particular double entendre, but sometimes I do contemplate it…

Comment by anewton — October 29, 2008

Leave a comment

You must be logged in to post a comment.