Created
January 10, 2013 21:33
-
-
Save beckyconning/4505987 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe("Infographic", function() { | |
var infographic; | |
beforeEach(function() { | |
loadFixtures('table.html'); | |
infographic = Infographic(); | |
$table = $('table'); | |
}); | |
describe("updateFromTable($table)", function() { | |
it("should update its data from the passed jquery table element", function() { | |
infographic.updateFromTable($table); | |
var tableCaption = $table.find('caption').text(); | |
var infographicCaption = infographic.caption() | |
expect(infographic.caption()).toEqual(tableCaption); | |
}); | |
}); | |
}); | |
var Infographic = function() { | |
var caption = ""; | |
var self = { | |
updateFromTable: function updateFromTable($table) { | |
caption = $table.find('caption').text(); | |
}, | |
caption: function caption() { | |
return caption; | |
} | |
}; | |
return self; | |
}; | |
module.exports = Infographic; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment