Mustang is a project mainly written in RUBY and C++, it's free.
(proof-of-concept) Awesome V8 JavaScript engine embedded into Ruby's shiny body.
Mustang development is proudly sponsored by Cubox, Agile Rails Devshop
Mustang is ruby proxy library for awesome Google V8 JavaScript engine.
JavaScript integration testing suite which contains more than 4000 steps and running time more that 2 hours... I think that's enough. There is lot of different ways to handle headless testing, but they all have lot of issues as well. They are super slow (Selenium, Watir), or they are not working with ruby 1.9 (Johsnon), or they requires tricky external stuff (Culerity/Celerity, Zombie). Our goal is to create fast javascript engine working fine on all popular ruby implementations (1.8.x, 1.9.x, ree, rubinius), and make it core element of headless, virtual browser for testing purposes (of course integrated with capybara and cucubmer).
Yeap, TheRubyRacer from Charles Lowell and PyV8 made big influence on our Mustang code, so let say now big thanks to the authors...
You can of course ask why we wrote library which seems to be very similar to TheRubyRacer... yeah it seems, but there are a lot of differences. Here is short comparison of TheRubyRacer and Mustang:
Similarities:
Diffs:
And the most important, like i said before, Mustang is used as core element of our bigger idea, so it have to exactly fit to our needs.
Before you install mustang gem make sure you have scons
installed.
$ sudo apt-get install scons # on debian
$ sudo pacman -S scons # on archlinux
$ brew install scons # on mac...
Using rubygems:
$ gem install mustang
Manually:
$ git clone git://github.com/nu7hatch/mustang.git
$ cd mustang
$ rake compile
$ rake install
For now it's only proof of concept. It implements very simple evaluation of javascript code:
require 'mustang'
cxt = Mustang::Context.new
cxt.eval("'Hello' + ' World!';") # => 'Hello World!'
cxt.eval("var a=1;")
cxt.eval("a+5;") # => 6
cxt[:puts] = method(:puts)
cxt.eval("puts(a)") # displays "1" on the screen
cxt[:a] # => 1
TODO: coming soon...
Copyright (c) 2010 Kriss 'nu7hatch' Kowalik. See LICENSE for details.