Skip to content

Commit

Permalink
Release 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Apr 9, 2009
1 parent f064848 commit 9951af4
Show file tree
Hide file tree
Showing 16 changed files with 1,315 additions and 39 deletions.
11 changes: 11 additions & 0 deletions History.rdoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@

=== 1.0.4 / 2009-04-09

* Added `jspec bind`
* Added `jspec run`
* Added `jspec init`
* Added `jspec` executable
* Added gemspec and manifest
* Added command-line usage docs
* Added custom matchers documentation
* Removed double negation

=== 1.0.3 / 2009-04-08

* Added have_prop matcher, have_property is now strict [#56]
Expand Down
3 changes: 2 additions & 1 deletion Manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin/jspec
History.rdoc
jspec.gemspec
lib/images/bg.png
lib/images/hr.png
lib/images/sprites.bg.png
Expand All @@ -8,6 +9,7 @@ lib/images/vr.png
lib/jspec.css
lib/jspec.jquery.js
lib/jspec.js
Manifest
Rakefile
README.rdoc
spec/async
Expand All @@ -22,4 +24,3 @@ templates/default/lib/yourlib.core.js
templates/default/README.rdoc
templates/default/spec/spec.core.js
templates/default/spec/spec.html
Manifest
2 changes: 1 addition & 1 deletion bin/jspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require 'fileutils'
JSPEC_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))

program :name, 'JSpec'
program :version, '1.0.1'
program :version, '1.0.4'
program :description, 'JavaScript BDD Testing Framework'
default_command :bind

Expand Down
36 changes: 0 additions & 36 deletions jspec.gemspec

This file was deleted.

2 changes: 1 addition & 1 deletion lib/jspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

JSpec = {

version : '1.0.3',
version : '1.0.4',
main : this,
suites : [],
matchers : {},
Expand Down
Binary file added pkg/images/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkg/images/hr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkg/images/sprites.bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkg/images/sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkg/images/vr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 129 additions & 0 deletions pkg/jspec.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
body.jspec {
margin: 45px 0;
text-align: center;
font: 12px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
background: #efefef url(images/bg.png) top left repeat-x;
}
#jspec {
margin: 0 auto;
padding-top: 25px;
width: 1008px;
background: url(images/vr.png) top left repeat-y;
text-align: left;
}
#jspec-top {
position: relative;
margin: 0 auto;
width: 1008px;
height: 40px;
background: url(images/sprites.bg.png) top left no-repeat;
}
#jspec-bottom {
margin: 0 auto;
width: 1008px;
height: 15px;
background: url(images/sprites.bg.png) bottom left no-repeat;
}
#jspec-title {
position: relative;
top: 35px;
left: 20px;
width: 160px;
font-size: 22px;
font-weight: normal;
background: url(images/sprites.png) 0 -126px no-repeat;
}
#jspec-title em {
font-size: 10px;
font-style: normal;
color: #BCC8D1;
}
#jspec-report * {
margin: 0;
padding: 0;
background: none;
border: none;
}
#jspec-report {
padding: 15px 40px;
font: 11px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
color: #7B8D9B;
}
#jspec-report.has-failures {
padding-bottom: 30px;
}
#jspec-report .hidden {
display: none;
}
#jspec-report .heading {
margin-bottom: 15px;
}
#jspec-report .heading span {
padding-right: 10px;
}
#jspec-report .heading .passes em {
color: #0ea0eb;
}
#jspec-report .heading .failures em {
color: #FA1616;
}
#jspec-report table {
width: 100%;
font-size: 11px;
border-collapse: collapse;
}
#jspec-report td {
padding: 8px;
text-indent: 30px;
color: #7B8D9B;
}
#jspec-report tr td:first-child em {
font-style: normal;
font-weight: normal;
color: #7B8D9B;
}
#jspec-report tr:not(.description):hover {
text-shadow: 1px 1px 1px #fff;
background: #F2F5F7;
}
#jspec-report td + td {
padding-right: 0;
width: 15px;
}
#jspec-report td.pass {
background: url(images/sprites.png) 3px -7px no-repeat;
}
#jspec-report td.fail {
background: url(images/sprites.png) 3px -47px no-repeat;
font-weight: bold;
color: #FC0D0D;
}
#jspec-report td.requires-implementation {
background: url(images/sprites.png) 3px -87px no-repeat;
}
#jspec-report tr.description td {
margin-top: 25px;
padding-top: 25px;
font-size: 12px;
font-weight: bold;
text-indent: 0;
color: #1a1a1a;
}
#jspec-report tr.description:first-child td {
border-top: none;
}
#jspec-report .assertion {
display: block;
float: left;
margin: 0 0 0 1px;
padding: 0;
width: 1px;
height: 5px;
background: #7B8D9B;
}
#jspec-report .assertion.failed {
background: red;
}
.jspec-sandbox {
display: none;
}
68 changes: 68 additions & 0 deletions pkg/jspec.jquery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

// JSpec - jQuery - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)

(function($, $$){

// --- Dependencies

$$.requires('jQuery', 'when using jspec.jquery.js')

// --- Async Support

$.ajaxSetup({ async : false })

// --- Helpers

$$.defaultContext.element = $
$$.defaultContext.elements = $
$$.defaultContext.defaultSandbox = $$.defaultContext.sandbox
$$.defaultContext.sandbox = function() { return $($$.defaultContext.defaultSandbox()) }

// --- Matchers

$$.addMatchers({
have_tag : "jQuery(expected, actual).length == 1",
have_one : "alias have_tag",
have_tags : "jQuery(expected, actual).length > 1",
have_many : "alias have_tags",
have_child : "jQuery(actual).children(expected).length == 1",
have_children : "jQuery(actual).children(expected).length > 1",
have_class : "jQuery(actual).hasClass(expected)",
have_text : "jQuery(actual).text() == expected",
have_value : "jQuery(actual).val() == expected",
be_visible : "!jQuery(actual).is(':hidden')",
be_hidden : "jQuery(actual).is(':hidden')",
be_enabled : "!jQuery(actual).attr('disabled')",

have_attr : { match : function(actual, attr, value) {
if (value) return $(actual).attr(attr) == value
else return $(actual).attr(attr)
}
}
})

// --- be_BOOLATTR

$$.each('disabled selected checked', function(attr){
$$.matchers['be_' + attr] = "jQuery(actual).attr('" + attr + "')"
})

// --- have_ATTR

$$.each('type id title alt href src rel rev name target', function(attr){
$$.matchers['have_' + attr] = { match : function(actual, value) {
return $$.matchers.have_attr.match(actual, attr, value)
}
}
})

// --- be_a_TYPE_input (deprecated)

$$.each('checkbox radio file password submit image text reset button', function(type){
console.warn("be_a_" + type + "_input is deprected; use have_type('" + type + "')");
JSpec.matchers['be_a_' + type + '_input'] = "jQuery(actual).get(0).type == '" + type + "'"
})

})(jQuery, JSpec)


12 changes: 12 additions & 0 deletions pkg/jspec.jquery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9951af4

Please sign in to comment.