Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Headless JavaScript testing with WebKit

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 ichabod.gemspec
README.md

Ichabod

Run JavaScript tests from the command line using a headless version of WebKit.

Features:

  • Jasmine tests support
  • QUnit tests support
  • Use Ruby methods from JavaScript

Prerequisites

The only prerequisites are OSX and macruby.

Installation

$ macgem install ichabod

Or, if you're using rvm:

$ rvm use macruby
$ gem install ichabod

Usage

ichabod ./your/file.html
ichabod http://example.com

ichabod --jasmine http://your-jasmine-test-page.html
ichabod --qunit http://your-qunit-test-page.html

ichabod --jasmin ./local-qunit-path/index.html
  xxxxxxxxxxxxxoxxxxxxxxxx

  - X failed because of xyz

More Usage

$ ichabod
js> 1 + 1
=> 2
js> function name() { return "ichabod!" }
=> undefined
js> name
=> function name() { return "ichabod!" }
js> name()
=> "ichabod!"
js> Ruby.puts('Ruby, I presume.')
Ruby, I presume.
=> undefined
js> Ruby.File_read('hi.js')
=> "// this is hi.js\n"
js> Ichabod.exit();

Credit

Credit should go to the real author behind this - Chris Wanstrath who wrote Lyndon. Most of the code follows his original ideas, I've extended that to add test support and enhancements to the WebKit WebView.

And thanks to my tweeps who suggested the name: knewter, tiegz, enriclluelles.

Copyright

Copyright (c) 2011 Chris Wanstrath, Alex MacCaw under the MIT LICENSE.

Something went wrong with that request. Please try again.