Bläddra i källkod

Changed wording of some specs

tags/0.7.0
Michael Jackson 13 år sedan
förälder
incheckning
afc6e0f1b1
2 ändrade filer med 23 tillägg och 23 borttagningar
  1. +8
    -8
      test/context_test.js
  2. +15
    -15
      test/scanner_test.js

+ 8
- 8
test/context_test.js Visa fil

@@ -9,10 +9,10 @@ vows.describe("Mustache.Context").addBatch({
var context = new Context(view);
return context;
},
"should be able to lookup properties of its own view": function (context) {
"is able to lookup properties of its own view": function (context) {
assert.equal(context.lookup("name"), "parent");
},
"should be able to lookup nested properties of its own view": function (context) {
"is able to lookup nested properties of its own view": function (context) {
assert.equal(context.lookup("a.b"), "b");
},
"when pushed": {
@@ -20,26 +20,26 @@ vows.describe("Mustache.Context").addBatch({
var view = { name: 'child', c: { d: 'd' } };
return context.push(view);
},
"should return the child context": function (context) {
"returns the child context": function (context) {
assert.equal(context.view.name, "child");
assert.equal(context.parent.view.name, "parent");
},
"should be able to lookup properties of its own view": function (context) {
"is able to lookup properties of its own view": function (context) {
assert.equal(context.lookup("name"), "child");
},
"should be able to lookup properties of the parent context's view": function (context) {
"is able to lookup properties of the parent context's view": function (context) {
assert.equal(context.lookup("message"), "hi");
},
"should be able to lookup nested properties of its own view": function (context) {
"is able to lookup nested properties of its own view": function (context) {
assert.equal(context.lookup("c.d"), "d");
},
"should be able to lookup nested properties of its parent view": function (context) {
"is able to lookup nested properties of its parent view": function (context) {
assert.equal(context.lookup("a.b"), "b");
}
} // when pushed
}, // A Context
"make": {
"should return the same object when given a Context": function () {
"returns the same object when given a Context": function () {
var context = new Context;
assert.strictEqual(Context.make(context), context);
}


+ 15
- 15
test/scanner_test.js Visa fil

@@ -6,7 +6,7 @@ vows.describe("Mustache.Scanner").addBatch({
"A Scanner": {
"for an empty string": {
topic: new Scanner(""),
"should be at the end of the string": function () {
"is at the end of the string": function () {
var scanner = new Scanner("");
assert(scanner.eos());
}
@@ -20,10 +20,10 @@ vows.describe("Mustache.Scanner").addBatch({
var match = scanner.scan(/a b c/);
this.callback(scanner, match);
},
"it should return the entire string": function (scanner, match) {
"returns the entire string": function (scanner, match) {
assert.equal(match, scanner.string);
},
"it should be at the end of the string": function (scanner, match) {
"is at the end of the string": function (scanner, match) {
assert(scanner.eos());
}
}, // when the regexp matches the entire string
@@ -34,10 +34,10 @@ vows.describe("Mustache.Scanner").addBatch({
var match = scanner.scan(/a/);
this.callback(scanner, match);
},
"it should return the portion of the string that was matched": function (scanner, match) {
"returns the portion of the string that was matched": function (scanner, match) {
assert.equal(match, "a");
},
"it should advance the internal pointer the length of the match": function (scanner, match) {
"advances the internal pointer the length of the match": function (scanner, match) {
assert.equal(scanner.pos, 1);
}
}, // at the 0th index
@@ -47,10 +47,10 @@ vows.describe("Mustache.Scanner").addBatch({
var match = scanner.scan(/b/);
this.callback(scanner, match);
},
"it should return the empty string": function (scanner, match) {
"returns the empty string": function (scanner, match) {
assert.equal(match, "");
},
"it should not advance the internal pointer": function (scanner, match) {
"does not advance the internal pointer": function (scanner, match) {
assert.equal(scanner.pos, 0);
}
} // at some index other than 0
@@ -61,10 +61,10 @@ vows.describe("Mustache.Scanner").addBatch({
var match = scanner.scan(/z/);
this.callback(scanner, match);
},
"it should return the empty string": function (scanner, match) {
"returns the empty string": function (scanner, match) {
assert.equal(match, "");
},
"it should not advance the internal pointer": function (scanner, match) {
"does not advance the internal pointer": function (scanner, match) {
assert.equal(scanner.pos, 0);
}
}
@@ -77,10 +77,10 @@ vows.describe("Mustache.Scanner").addBatch({
var match = scanner.scanUntil(/a/);
this.callback(scanner, match);
},
"it should return the empty string": function (scanner, match) {
"returns the empty string": function (scanner, match) {
assert.equal(match, "")
},
"it should not advance the internal pointer": function (scanner, match) {
"does not advance the internal pointer": function (scanner, match) {
assert.equal(scanner.pos, 0);
}
},
@@ -90,10 +90,10 @@ vows.describe("Mustache.Scanner").addBatch({
var match = scanner.scanUntil(/b/);
this.callback(scanner, match);
},
"it should return the portion of the string it scanned": function (scanner, match) {
"returns the portion of the string it scanned": function (scanner, match) {
assert.equal(match, "a ");
},
"it should advance the internal pointer the length of the match": function (scanner, match) {
"advances the internal pointer the length of the match": function (scanner, match) {
assert.equal(scanner.pos, 2);
}
}
@@ -104,10 +104,10 @@ vows.describe("Mustache.Scanner").addBatch({
var match = scanner.scanUntil(/z/);
this.callback(scanner, match);
},
"it should return the entire string": function (scanner, match) {
"returns the entire string": function (scanner, match) {
assert.equal(match, scanner.string);
},
"it should be at the end of the string": function (scanner, match) {
"is at the end of the string": function (scanner, match) {
assert(scanner.eos());
}
} // when the regexp doesn't match


Laddar…
Avbryt
Spara