Created
September 21, 2010 23:03
-
-
Save cdwillie76/590750 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
module("Pub"); | |
var pubFixture = new Pub(); | |
test("key getter", function() { | |
pubFixture.point = {lat: 1234, long: 5678}; | |
equals(pubFixture.key, "1234,5678", "Key property did not return comma delimited version of Point"); | |
}); | |
module("Crawl"); | |
var pub1 = new Pub(); | |
pub1.name = "Pub 1" | |
pub1.point = {lat: 1234, long: 5678}; | |
var pub2 = new Pub(); | |
pub2.name = "Pub 2" | |
pub2.point = {lat: 12345, long: 56789}; | |
var crawlFixture = new Crawl(); | |
test("key getter", function() { | |
crawlFixture.name = "Crawl Name"; | |
equals(crawlFixture.key, "Crawl Name", "Key property did not return the name"); | |
}); | |
test("add pubs with no duplicates", function() { | |
crawlFixture.addPub(pub1); | |
crawlFixture.addPub(pub2); | |
equals(crawlFixture.pubs.length, 2, "Pubs[] is not equal to 2"); | |
}); | |
test("add pubs with duplicates", function() { | |
crawlFixture.addPub(pub1); | |
crawlFixture.addPub(pub1); | |
equals(crawlFixture.pubs.length, 2, "Pubs[] is not equal to 1"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment