Skip to content

Commit

Permalink
Merge pull request #87 from hhzl/fixExpectToBeString
Browse files Browse the repository at this point in the history
Fix expect to be string
  • Loading branch information
hhzl authored Dec 8, 2016
2 parents 6e68b1e + 4c57eb7 commit 39a447e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions spec/learnwords2/LWBoxOfQuestionsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("BoxOfQuestions construction", function() {

expect(LW).toBeObject();

expect(LW.db.dbName).toBeString("learnWords");
expect(LW.db.dbName).toBe("learnWords");
expect(LW.db.numberOfWords()).toBeNumber(10);

});
Expand Down Expand Up @@ -55,7 +55,7 @@ describe("BoxOfQuestions construction", function() {

expect(LW).toBeObject();

expect(LW.db.dbName).toBeString("learnWords");
expect(LW.db.dbName).toBe("learnWords");
expect(LW.db.numberOfWords()).toBeNumber(10);

});
Expand Down
13 changes: 6 additions & 7 deletions spec/learnwords2/LWdbSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ describe("Database LWdb", function() {
expect(this.db).toBeObject();

expect(this.db).toHaveString("dbName");
expect(this.db.dbName).toBeString("LearnWords");

expect(this.db.dbName).toBe("LearnWords");
expect(this.db).toHaveArray("_keysOfAllWords");

});
Expand Down Expand Up @@ -102,10 +101,10 @@ describe("Database LWdb", function() {
expect(r._id).toBe(1);

expect(r).toHaveString("word");
expect(r.word).toBeString("melon");
expect(r.word).toBe("melon");

expect(r).toHaveString("translate");
expect(r.translate).toBeString("melon");
expect(r.translate).toBe("die Melone");

expect(r).toHaveNumber("step");
expect(r.step).toBe(0);
Expand Down Expand Up @@ -160,7 +159,7 @@ describe("Database LWdb", function() {
expect(r.length).toBe(this.db.numberOfWords());

for(var i = 0; i < r.length; i++){
expect(r[i]).toBeString("LearnWords-wd-"+(i+1));
expect(r[i]).toBe("LearnWords-wd-"+(i+1));
}

});
Expand Down Expand Up @@ -208,11 +207,11 @@ describe("Database LWdb", function() {

expect(r[i]).toHaveString("word");
expect(tmp).toHaveString("word");
expect(r[i].word).toBeString(tmp.word);
expect(r[i].word).toBe(tmp.word);

expect(r[i]).toHaveString("translate");
expect(tmp).toHaveString("translate");
expect(r[i].translate).toBeString(tmp.translate);
expect(r[i].translate).toBe(tmp.translate);

expect(r[i]).toHaveNumber("_id");
expect(tmp).toHaveNumber("_id");
Expand Down

0 comments on commit 39a447e

Please sign in to comment.