Skip to content

Commit

Permalink
Allow pending examples
Browse files Browse the repository at this point in the history
Simply drop the second argument to it() to use, eg -

  it("should solve world peace");

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
  • Loading branch information
Jonathan del Strother authored and Jonathan del Strother committed Jul 22, 2008
1 parent cc41f3c commit f8a0b6b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion lib/screw.builder.js
Expand Up @@ -35,7 +35,14 @@ var Screw = (function($) {
},

it: function(name, fn) {
var it = $('<li class="it">')
var className = "it";
if (arguments.length < 2) {
name += " (pending)";
className = "pending";
fn = function(){};
}
var it = $('<li>')
.addClass(className)
.append($('<h2>').text(name))
.data('screwunit.run', fn);

Expand Down
6 changes: 4 additions & 2 deletions lib/screw.css
Expand Up @@ -47,12 +47,14 @@ html {

.describes .describe .its {}

.describes .describe .its .it {
.describes .describe .its .it,
.describes .describe .its .pending {
list-style-type: lower-roman;
list-style-position: outside;
}

.describes .describe .its .it h2 {
.describes .describe .its .it h2,
.describes .describe .its .pending h2 {
font-weight: normal;
font-style: italic;
padding-left: 0.5em;
Expand Down
2 changes: 2 additions & 0 deletions spec/behaviors_spec.js
Expand Up @@ -5,6 +5,8 @@ Screw.Unit(function() {

describe('Behaviors', function() {
describe('#run', function() {
it("shouldn't run pending specs");

describe("a simple [describe]", function() {
it("invokes the global [before] before an [it]", function() {
expect(global_before_invoked).to(equal, true);
Expand Down

0 comments on commit f8a0b6b

Please sign in to comment.