Skip to content

Instantly share code, notes, and snippets.

@juno
Created December 7, 2010 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juno/731656 to your computer and use it in GitHub Desktop.
Save juno/731656 to your computer and use it in GitHub Desktop.
beforeEachを使った例。
/**
* Array クラスのテスト
*/
describe("Array クラスは", function() {
var arr = null;
beforeEach(function() {
arr = [1, 2, 3];
});
it('length プロパティで配列長を取得する事ができる', function() {
expect(arr.length).toEqual(3);
});
it('shift メソッドにより配列の先頭要素を取り出す事ができる', function() {
expect(arr.shift()).toEqual(1);
expect(arr[0]).toEqual(2);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment