Last active
September 2, 2015 00:42
-
-
Save joshuaebowling/234a6705643a45ee24c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assuming Jasmine | |
// Assuming NAMESPACE is defined and is as id.js defines it. | |
describe('Test validity of my changes to id.js', function() { | |
beforeAll(function() { | |
// add some "id"s to the Array prototype | |
var self; | |
self = this; | |
self.testData = [ | |
'joshuaebowling', 'posita' | |
]; | |
}); | |
it('Create an instance of NAMESPACE.id, check getId, close, and whether close removes instance\'s from the NAMESPACE._all_ids', function() { | |
var self, myPersona, myId; | |
self = this; | |
// yes, I'm joshuaebowling | |
myId = self.testData[0]; | |
myPersona = NAMESPACE.id(myId); | |
expect(typeof myPersona).toBe('object'); | |
expect(typeof myPersona.getId).toBe('function'); | |
expect(typeof myPersona.close).toBe('function'); | |
expect(myPersona.getId()).toBe(myId); | |
myPersona.close(); | |
expect(NAMESPACE._all_ids[myPersona.getId()]).toBeUndefined(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment