spec/javascripts/appSpec.js in appjs-rails-1.0.1 vs spec/javascripts/appSpec.js in appjs-rails-1.0.2

- old
+ new

@@ -1,15 +1,18 @@ describe("app", function() { - beforeEach(function() { - app._singleton.add('example', function(){}); - }); + describe("#_singleton", function() { + it("should be able to create example singleton without initialize", function() { + app._singleton.add('singletonAdd', function(){}); + expect(app.singletonAdd).not.toEqual(undefined); + }); - it("should be able to create example singleton", function() { - expect(app.example).not.toEqual(undefined); + it("should be able to create example singleton with initialize", function() { + app._singleton.init('singletonInit', function(){return {toString: "Init"}}); + expect(app.singletonInit['toString']).toEqual('Init'); + }); }); it("should generate an uuid", function() { expect(app._uuid()).toMatch(/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/); }); - });