Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed JSTestSan to Headless Squirrel

  • Loading branch information...
commit 54f391c4a9809b9fc590eb7304c8e5afc0e4b2d0 1 parent 42fbdab
@alloy alloy authored
View
13 README.rdoc
@@ -1,7 +1,6 @@
-= JSTestSan
+= Headless Squirrel
-A JavaScript test runner to run JavaScript tests from the comfort of your
-terminal.
+A JavaScript test runner to run tests from the comfort of your terminal.
== Why?
@@ -13,9 +12,11 @@ browsers as well, you know, html and js… This way we can run the tests from th
terminal during regular development but still test on other browsers by loading
the html/js files manually.
+Read more at http://superalloy.nl/2009/04/13/js-test-san.html
+
== Install & Usage
- $ sudo gem install alloy-js-test-san -s http://gems.github.com
+ $ sudo gem install Fingertips-headless-squirrel -s http://gems.github.com
$ jstest path/to/a/unit_test.html
To automatically run your test see http://github.com/alloy/kicker/tree/master.
@@ -47,4 +48,6 @@ This is the output of the regression tests which are the Prototype unit tests:
Finished in 17.725139 seconds.
- 356 tests, 2246 assertions, 2 failures, 0 errors
+ 356 tests, 2246 assertions, 2 failures, 0 errors
+
+See regression_test.rdoc[link:regression_test.rdoc] for more tests.
View
8 Rakefile
@@ -5,7 +5,7 @@ task :test do
sh "specrb -s #{Dir['test/unit/*_test.rb'].join(' ')}"
end
-# JSTestSan::Rake::Runner.new :regression do |t|
+# HeadlessSquirrel::Rake::Runner.new :regression do |t|
# t.files = Dir['test/regression/prototype/unit/*.html']
# end
@@ -29,10 +29,10 @@ end
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
- gemspec.name = "js-test-san"
- gemspec.summary = gemspec.description = "A JavaScript test runner which runs from the comfort of the terminal. OS X only."
+ gemspec.name = "headless-squirrel"
+ gemspec.summary = gemspec.description = "A command-line JavaScript test runner for the Mac."
gemspec.email = "eloy.de.enige@gmail.com"
- gemspec.homepage = "http://github.com/alloy/js-test-san/tree/master"
+ gemspec.homepage = "http://github.com/Fingertips/headless-squirrel/tree/master"
gemspec.authors = ["Eloy Duran"]
end
rescue LoadError
View
4 bin/jstest
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby
$:.unshift File.expand_path('../../lib', __FILE__)
-require 'js_test_san'
+require 'headless_squirrel'
if ARGV.empty?
puts "Usage: #{$0} [html files]"
else
- JSTestSan::Runner.alloc.initWithHTMLFiles(ARGV).run
+ HeadlessSquirrel::Runner.alloc.initWithHTMLFiles(ARGV).run
end
View
131 js-test-san.gemspec
@@ -1,131 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{js-test-san}
- s.version = "0.1.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Eloy Duran"]
- s.date = %q{2009-04-12}
- s.default_executable = %q{jstest}
- s.description = %q{A JavaScript test runner which runs from the comfort of the terminal. OS X only.}
- s.email = %q{eloy.de.enige@gmail.com}
- s.executables = ["jstest"]
- s.extra_rdoc_files = [
- "README.rdoc"
- ]
- s.files = [
- "README.rdoc",
- "Rakefile",
- "VERSION.yml",
- "bin/jstest",
- "lib/js_test_san.rb",
- "lib/js_test_san/runner.rb",
- "lib/js_test_san/test.rb",
- "lib/js_test_san/test_case.rb",
- "test/fixtures/a_unit_test.html",
- "test/fixtures/a_unit_test.js",
- "test/regression/prototype/unit/ajax_test.html",
- "test/regression/prototype/unit/array_test.html",
- "test/regression/prototype/unit/assets/prototype.js",
- "test/regression/prototype/unit/assets/unittest.css",
- "test/regression/prototype/unit/assets/unittest.js",
- "test/regression/prototype/unit/assets/unittest_transport.js",
- "test/regression/prototype/unit/base_test.html",
- "test/regression/prototype/unit/class_test.html",
- "test/regression/prototype/unit/date_test.html",
- "test/regression/prototype/unit/dom_test.html",
- "test/regression/prototype/unit/element_mixins_test.html",
- "test/regression/prototype/unit/enumerable_test.html",
- "test/regression/prototype/unit/event_test.html",
- "test/regression/prototype/unit/fixtures/ajax.html",
- "test/regression/prototype/unit/fixtures/ajax.js",
- "test/regression/prototype/unit/fixtures/array.html",
- "test/regression/prototype/unit/fixtures/class.js",
- "test/regression/prototype/unit/fixtures/content.html",
- "test/regression/prototype/unit/fixtures/data.json",
- "test/regression/prototype/unit/fixtures/dom.css",
- "test/regression/prototype/unit/fixtures/dom.html",
- "test/regression/prototype/unit/fixtures/dom.js",
- "test/regression/prototype/unit/fixtures/element_mixins.html",
- "test/regression/prototype/unit/fixtures/element_mixins.js",
- "test/regression/prototype/unit/fixtures/empty.html",
- "test/regression/prototype/unit/fixtures/empty.js",
- "test/regression/prototype/unit/fixtures/enumerable.html",
- "test/regression/prototype/unit/fixtures/enumerable.js",
- "test/regression/prototype/unit/fixtures/event.html",
- "test/regression/prototype/unit/fixtures/form.html",
- "test/regression/prototype/unit/fixtures/function.js",
- "test/regression/prototype/unit/fixtures/hash.js",
- "test/regression/prototype/unit/fixtures/hello.js",
- "test/regression/prototype/unit/fixtures/logo.gif",
- "test/regression/prototype/unit/fixtures/object.html",
- "test/regression/prototype/unit/fixtures/object.js",
- "test/regression/prototype/unit/fixtures/position.html",
- "test/regression/prototype/unit/fixtures/selector.html",
- "test/regression/prototype/unit/fixtures/string.js",
- "test/regression/prototype/unit/fixtures/unittest.html",
- "test/regression/prototype/unit/form_test.html",
- "test/regression/prototype/unit/function_test.html",
- "test/regression/prototype/unit/hash_test.html",
- "test/regression/prototype/unit/number_test.html",
- "test/regression/prototype/unit/object_test.html",
- "test/regression/prototype/unit/periodical_executer_test.html",
- "test/regression/prototype/unit/position_test.html",
- "test/regression/prototype/unit/prototype_test.html",
- "test/regression/prototype/unit/range_test.html",
- "test/regression/prototype/unit/regexp_test.html",
- "test/regression/prototype/unit/selector_test.html",
- "test/regression/prototype/unit/string_test.html",
- "test/regression/prototype/unit/tests/ajax_test.js",
- "test/regression/prototype/unit/tests/array_test.js",
- "test/regression/prototype/unit/tests/base_test.js",
- "test/regression/prototype/unit/tests/class_test.js",
- "test/regression/prototype/unit/tests/date_test.js",
- "test/regression/prototype/unit/tests/dom_test.js",
- "test/regression/prototype/unit/tests/element_mixins_test.js",
- "test/regression/prototype/unit/tests/enumerable_test.js",
- "test/regression/prototype/unit/tests/event_test.js",
- "test/regression/prototype/unit/tests/form_test.js",
- "test/regression/prototype/unit/tests/function_test.js",
- "test/regression/prototype/unit/tests/hash_test.js",
- "test/regression/prototype/unit/tests/number_test.js",
- "test/regression/prototype/unit/tests/object_test.js",
- "test/regression/prototype/unit/tests/periodical_executer_test.js",
- "test/regression/prototype/unit/tests/position_test.js",
- "test/regression/prototype/unit/tests/prototype_test.js",
- "test/regression/prototype/unit/tests/range_test.js",
- "test/regression/prototype/unit/tests/regexp_test.js",
- "test/regression/prototype/unit/tests/selector_test.js",
- "test/regression/prototype/unit/tests/string_test.js",
- "test/regression/prototype/unit/tests/unittest_test.js",
- "test/regression/prototype/unit/unittest_test.html",
- "test/regression/prototype/upstream",
- "test/test_helper.rb",
- "test/unit/runner_test.rb",
- "test/unit/test_case_test.rb",
- "test/unit/test_test.rb"
- ]
- s.has_rdoc = true
- s.homepage = %q{http://github.com/alloy/js-test-san/tree/master}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.1}
- s.summary = %q{A JavaScript test runner which runs from the comfort of the terminal. OS X only.}
- s.test_files = [
- "test/test_helper.rb",
- "test/unit/runner_test.rb",
- "test/unit/test_case_test.rb",
- "test/unit/test_test.rb"
- ]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 2
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
-end
View
2  lib/headless_squirrel.rb
@@ -0,0 +1,2 @@
+require 'headless_squirrel/test_case'
+require 'headless_squirrel/runner'
View
2  lib/js_test_san/runner.rb → lib/headless_squirrel/runner.rb
@@ -1,6 +1,6 @@
require 'osx/cocoa'
-module JSTestSan
+module HeadlessSquirrel
class Runner < OSX::NSObject
attr_reader :test_cases, :queued, :did_not_pass
View
2  lib/js_test_san/test.rb → lib/headless_squirrel/test.rb
@@ -1,4 +1,4 @@
-module JSTestSan
+module HeadlessSquirrel
class TestCase < OSX::NSObject
class Test
attr_reader :test_case, :name, :state, :output
View
4 lib/js_test_san/test_case.rb → lib/headless_squirrel/test_case.rb
@@ -1,9 +1,9 @@
require "osx/cocoa"
OSX.require_framework 'WebKit'
-require 'js_test_san/test'
+require 'headless_squirrel/test'
-module JSTestSan
+module HeadlessSquirrel
class TestCase < OSX::NSObject
class FileDoesNotExistError < StandardError; end
View
2  lib/js_test_san.rb
@@ -1,2 +0,0 @@
-require 'js_test_san/test_case'
-require 'js_test_san/runner'
View
2  test/fixtures/a_unit_test.html
@@ -2,7 +2,7 @@
"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>A JSTestSan Unit Test HTML File</title>
+ <title>A HeadlessSquirrel Unit Test HTML File</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8">
View
2  test/test_helper.rb
@@ -3,7 +3,7 @@
require 'mocha'
$:.unshift File.expand_path('../../lib', __FILE__)
-require 'js_test_san'
+require 'headless_squirrel'
FIXTURES = File.expand_path('../fixtures', __FILE__)
View
12 test/unit/runner_test.rb
@@ -3,7 +3,7 @@
module RunnerTestHelper
def setup
files = [fixture('a_unit_test.html'), fixture('a_unit_test.html')]
- @runner = JSTestSan::Runner.alloc.initWithHTMLFiles(files)
+ @runner = HeadlessSquirrel::Runner.alloc.initWithHTMLFiles(files)
@runner.stubs(:puts)
@runner.stubs(:print)
@@ -17,16 +17,16 @@ def setup
private
def test_stub(name)
- test_case = JSTestSan::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), stub_everything)
+ test_case = HeadlessSquirrel::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), stub_everything)
test_case.stubs(:title).returns("A test case with #{name}")
- JSTestSan::TestCase::Test.new(test_case, name.to_s, name.to_sym, name.to_s)
+ HeadlessSquirrel::TestCase::Test.new(test_case, name.to_s, name.to_sym, name.to_s)
end
end
-describe "JSTestSan::Runner" do
+describe "HeadlessSquirrel::Runner" do
include RunnerTestHelper
- it "should have instantiated a JSTestSan::TestCase for each html file" do
+ it "should have instantiated a HeadlessSquirrel::TestCase for each html file" do
@runner.test_cases.length.should == 2
@runner.test_cases.each do |test_case|
test_case.html_file.should == fixture('a_unit_test.html')
@@ -121,7 +121,7 @@ def test_stub(name)
end
end
-describe "JSTestSan::Runner, when finalizing" do
+describe "HeadlessSquirrel::Runner, when finalizing" do
include RunnerTestHelper
def setup
View
24 test/unit/test_case_test.rb
@@ -1,15 +1,15 @@
require File.expand_path('../../test_helper', __FILE__)
-describe "JSTestSan::TestCase, class methods" do
+describe "HeadlessSquirrel::TestCase, class methods" do
it "should return a shared WebView instance" do
- JSTestSan::TestCase.sharedWebView.should.be.instance_of OSX::WebView
+ HeadlessSquirrel::TestCase.sharedWebView.should.be.instance_of OSX::WebView
end
end
-describe "JSTestSan::TestCase" do
+describe "HeadlessSquirrel::TestCase" do
before do
@delegate = stub_everything('delegate')
- @test_case = JSTestSan::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
+ @test_case = HeadlessSquirrel::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
end
it "should initialize with a html file and delegate" do
@@ -19,12 +19,12 @@
it "should raise a FileDoesNotExistError if the given html file does not exist" do
lambda {
- JSTestSan::TestCase.alloc.initWithHTMLFile_delegate('/does/not/exist/test.html', @delegate)
- }.should.raise JSTestSan::TestCase::FileDoesNotExistError
+ HeadlessSquirrel::TestCase.alloc.initWithHTMLFile_delegate('/does/not/exist/test.html', @delegate)
+ }.should.raise HeadlessSquirrel::TestCase::FileDoesNotExistError
end
it "should instantiate a WebView with the html file and set itself as the frameLoadDelegate" do
- @test_case.webView.should == JSTestSan::TestCase.sharedWebView
+ @test_case.webView.should == HeadlessSquirrel::TestCase.sharedWebView
@test_case.webView.mainFrameURL.should == "file://#{fixture('a_unit_test.html')}"
@test_case.webView.frameLoadDelegate.should == @test_case
end
@@ -46,10 +46,10 @@
end
end
-describe "JSTestSan::TestCase, when running" do
+describe "HeadlessSquirrel::TestCase, when running" do
before do
@delegate = stub_everything('delegate')
- @test_case = JSTestSan::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
+ @test_case = HeadlessSquirrel::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
run_test_case!
end
@@ -58,8 +58,8 @@
end
it "should have stored the document title" do
- @test_case.title.should == 'A JSTestSan Unit Test HTML File'
- @test_case.instance_variable_get(:@title).should == 'A JSTestSan Unit Test HTML File'
+ @test_case.title.should == 'A HeadlessSquirrel Unit Test HTML File'
+ @test_case.instance_variable_get(:@title).should == 'A HeadlessSquirrel Unit Test HTML File'
end
it "should return the `log' element" do
@@ -121,7 +121,7 @@
end
it "should let its delegate know a test ran if the targets class is one of passed, failed, or error" do
- @test_case = JSTestSan::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
+ @test_case = HeadlessSquirrel::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
@delegate.expects(:test_ran).times(3).with do |test|
test.name.should == case test.state
View
6 test/unit/test_test.rb
@@ -1,12 +1,12 @@
require File.expand_path('../../test_helper', __FILE__)
-describe "JSTestSan::TestCase::Test" do
+describe "HeadlessSquirrel::TestCase::Test" do
before do
@delegate = stub_everything('delegate')
- @test_case = JSTestSan::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
+ @test_case = HeadlessSquirrel::TestCase.alloc.initWithHTMLFile_delegate(fixture('a_unit_test.html'), @delegate)
@test_case.instance_variable_set(:@title, 'A test case')
- @test = JSTestSan::TestCase::Test.new(@test_case, 'testHelloWorld', :failed, 'did not meet expectation')
+ @test = HeadlessSquirrel::TestCase::Test.new(@test_case, 'testHelloWorld', :failed, 'did not meet expectation')
end
it "should initialize with a TestCase, name, state and output" do
Please sign in to comment.
Something went wrong with that request. Please try again.