summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilson Page <wilsonpage@me.com>2013-08-26 23:32:32 +0100
committerWilson Page <wilsonpage@me.com>2013-08-26 23:32:32 +0100
commitd3c0846673a410c79fafacbb52d099ac136fd17d (patch)
treed5beba388bd444b3547ff0ec07ad48aa763e9c77
parentee451fcea25864445f30e6fd45eff4a1e186c773 (diff)
downloadfastdom-d3c0846673a410c79fafacbb52d099ac136fd17d.zip
fastdom-d3c0846673a410c79fafacbb52d099ac136fd17d.tar.gz
fastdom-d3c0846673a410c79fafacbb52d099ac136fd17d.tar.bz2
Write context argument tests
-rw-r--r--test/test-setting.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test-setting.js b/test/test-setting.js
index 09f4b25..0b4fa88 100644
--- a/test/test-setting.js
+++ b/test/test-setting.js
@@ -102,5 +102,27 @@ buster.testCase('DomBatch', {
done();
});
});
+ },
+
+ "Should call a 'read' callback with the given context": function(done) {
+ var dom = new DomBatch();
+ var cb = this.spy();
+ var ctx = { foo: 'bar' };
+
+ dom.read(function() {
+ assert.equals(this.foo, 'bar');
+ done();
+ }, ctx);
+ },
+
+ "Should call a 'write' callback with the given context": function(done) {
+ var dom = new DomBatch();
+ var cb = this.spy();
+ var ctx = { foo: 'bar' };
+
+ dom.write(function() {
+ assert.equals(this.foo, 'bar');
+ done();
+ }, ctx);
}
}); \ No newline at end of file