Prototype needs your documentation skills—a new super-cool documentation site is in the making, and it needs your help.
Get on board already!
As promised, here are the slides on unit testing JavaScript from my talk at RailsConf Europe:
Adventures in JavaScript testing (PDF, 11.7 MB)
I also hear that audio (and video?) might be forthcoming, but I can’t promise anything on that. Anyway, as soon as I get some rest, I’ll also post some photos from the conference. :)
Tomorrow we’ll make a short trip over to London for RailsConf Europe where I’ll be talking about Adventures in JavaScript Testing.
Here’s a teaser:
I assure you, there is. Drop by my talk if you want to know more. I’ll also post the talk here on mir.aculo.us after the conference, of course.
Hope to see some of my humble readers at the conference!
Justin Palmer on the recent updates to the Prototype trunk.
Borrowing from Behaviour Driven Development techniques, especially the RSpec framework I’ve added some new features to script.aculo.us’ testing library.
It’s all about more readability, and even non-technical folk should be able to comprehend (at least some) of the tests. Let’s have a look:
Test.context("BDD-style testing",{ 'should automatically add extensions to strings': function(){ 'a'.shouldEqual('a'); 'a'.shouldNotEqual('b'); 'a'.shouldNotBeNull(); 'a'.shouldBeA(String); 'a'.shouldNotBeA(Number); } });Basically, you’re defining a context for which one or more specifications should be asserted. Note the easy readability, and the added value by using a string to describe the test/specification, giving you the advantage of having better documentation for your JavaScript libraries.
Of course, setup and teardown is also supported, as are all normal assert* methods.
If you code in the Prototoypian way, with proper objects, an other added value, especially for higher-level behavioural specifications is:
var testObj = { isNice: function(){ return true; }, isBroken: function(){ return false; } } // in Test.context 'should add object extensions': function(){ Object.extend(testObj, Test.BDDMethods); testObj.shouldBe('nice'); testObj.shouldNotBe('broken'); },Note that the support for this is far from complete, and JavaScript has certain limitatons that won’t allow all the elegant solutions that are possible with Ruby, but your tests can get much cleaner this way.
For now, you’ll need the script.aculo.us version from the SVN trunk. For more examples, see the repository file browser: test file, test library.
Decorator pattern in JavaScript? Sure can do. Read the article on how to augment arbitrary JavaScript objects with custom before and after events.
Basically, it boils down to this:
actsAsDecorator(Ajax.InPlaceEditor.prototype); Ajax.InPlaceEditor.prototype.after( 'enterEditMode', function() { // do something } );Nicely done, and very useful to add your own tweaks to existing JavaScript controls and components.
I’m very proud that I’m part of the wollzelle team. Read more on the wollzelle blog, typestorming.
The script.aculo.us site just got relaunched—it’s now easier to get a grasp of what it does, plus you’ll get the stuff that you need faster.
And, it’s much spiffier now.
Note the wiki is not affected by this, so everything there should be in the same place for you to find. At this occasion I want to thank the myriads of authors that keep adding documentation, tricks and real-world experience for all those new (or-not-so-new) to the wonderful world of script.aculo.us. Thanks a bunch!
Also, there’s been a bunch of updates since 1.6.2, so we’re steadily proceeding towards a 1.7 release in the not-so-distant future.
The rails-spinoffs mailing list (and the other rails lists too) have been moved to Google Groups because over permenant server overload. So, give a warm welcome to the new group at: http://groups.google.com/group/rubyonrails-spinoffs
All old subscriptions have been moved along, so nothing much should change for those of you already subscribed. For those of you that want to subscribe, you can do it either at web page (if you have a google account), or by sending a subscription mail.
Next to making sure that the Trac has room to breathe, you can enjoy some nice new features, like the web interface, RSS feeds and of course powerful searching.
Read more on this on Riding Rails, the official Rails blog.
After four long months of waiting (due to my being busy with sekrit work), script.aculo.us 1.6.2 is now out!
It’s a mostly-bug-fix-only release, so don’t expect any major oohs! and aahs! here, but sure get it. It’s recommended for all users, and addresses various more-or-less cosmetically issues, besides a memory leak bug with Draggables and an endless loop in the Slider code.
Anyway, big, big thanks to all contributors who continue to do patches and bug reports! Hopefully the trac will be up to speed soon (new server is coming!). If you should have any issues, please report it to the rails-spinoffs mailing list.
Updates and fixes:
There are also some updated functional and unit tests (use these links to get to live online versions of these).
Also, this version of script.aculo.us is now included with Edge Rails (as of changeset 4765), and should be part of the upcoming (as in “when it’s ready”) Rails 1.2 release.
Next up: Planning the script.aculo.us 2 release… ;)
The next release of Apple’s operating system Mac OS X 10.5 will ship with Ruby on Rails installed (read more on this at Riding Rails).
Cool stuff indeed.
We at wollzelle launched our new blog today: typestorming—so, if you want to have a look at our projects and other stuff we do, be sure to check it out.
It also lists some stuff we’ve not announced elsewhere, like the Chang restaurants Ajax site, among other things.
Like the fluxiom blog, it’s based on Mephisto, a great Rails blog app.
So, see you over at typestorming
Check out Amy Hoy’s JavaScript Boot Camp tutorial, highly recommended!