summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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