コード例 #1
0
ファイル: server_spec.js プロジェクト: jamessbull/nodelbrot
 it("should return the supplied function", function () {
     var serverFunction = function () { return "testServerFunction"; },
         server = webServer.create({ http: httpStub, portNo: 8095, router: serverFunction});
     expect(server.serverFunction).toBe(serverFunction);
 });
コード例 #2
0
ファイル: server_spec.js プロジェクト: jamessbull/nodelbrot
 it("should start serving on the desired port", function () {
     var server = webServer.create({ http: httpStub, portNo: 8095, router: {}});
     server.start();
     expect(httpStub.createCalled()).toBe(1);
     expect(httpStub.listeningOn()).toBe(8095);
 });
コード例 #3
0
ファイル: server_spec.js プロジェクト: jamessbull/nodelbrot
 it("should use the supplied function", function () {
     var serverFunction = function () { return "testServerFunction"; };
     webServer.create({ http: httpStub, portNo: 8095, router: serverFunction});
     expect(httpStub.callSuppliedFunction()).toBe("testServerFunction");
 });