aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-07-06 08:13:15 -0700
committerJames Lal <james@lightsofapollo.com>2012-07-06 08:13:15 -0700
commit20711f003e97a4a57d1e2838ba78a994c5faf6c0 (patch)
treeb060e5de05a9ffefc2ec836469c087fffa99dcef /test
parentc8e85fe1e0a1d2e15df580068244324ff536a23a (diff)
downloadjsCalDAV-20711f003e97a4a57d1e2838ba78a994c5faf6c0.tar.gz
webcals -> caldav rename (yes, back again)
Diffstat (limited to 'test')
-rw-r--r--test/caldav/ical_test.js (renamed from test/webcals/ical_test.js)6
-rw-r--r--test/caldav/index_test.js33
-rw-r--r--test/caldav/request/abstract_test.js (renamed from test/webcals/request/abstract_test.js)10
-rw-r--r--test/caldav/request/calendar_query_test.js (renamed from test/webcals/request/calendar_query_test.js)18
-rw-r--r--test/caldav/request/propfind_test.js (renamed from test/webcals/request/propfind_test.js)14
-rw-r--r--test/caldav/resource_root_test.js (renamed from test/webcals/resource_root_test.js)0
-rw-r--r--test/caldav/sax/base_test.js (renamed from test/webcals/sax/base_test.js)6
-rw-r--r--test/caldav/sax/dav_response_test.js (renamed from test/webcals/sax/dav_response_test.js)8
-rw-r--r--test/caldav/sax_test.js (renamed from test/webcals/sax_test.js)6
-rw-r--r--test/caldav/template_test.js (renamed from test/webcals/template_test.js)2
-rw-r--r--test/caldav/templates/calendar_data_test.js (renamed from test/webcals/templates/calendar_data_test.js)6
-rw-r--r--test/caldav/templates/calendar_filter_test.js (renamed from test/webcals/templates/calendar_filter_test.js)6
-rw-r--r--test/caldav/xhr_test.js (renamed from test/webcals/xhr_test.js)4
-rw-r--r--test/helper.js10
-rw-r--r--test/support/fake_xhr.js6
-rw-r--r--test/webcals/index_test.js13
16 files changed, 84 insertions, 64 deletions
diff --git a/test/webcals/ical_test.js b/test/caldav/ical_test.js
index 7e424f3..9c7763e 100644
--- a/test/webcals/ical_test.js
+++ b/test/caldav/ical_test.js
@@ -1,12 +1,12 @@
testSupport.lib('ical'),
-suite('webcals/ics', function() {
+suite('caldav/ics', function() {
var ical;
suiteSetup(function() {
- console.log(Webcals);
- ical = Webcals.require('ical');
+ console.log(Caldav);
+ ical = Caldav.require('ical');
});
test('intiailizer', function() {
diff --git a/test/caldav/index_test.js b/test/caldav/index_test.js
new file mode 100644
index 0000000..fb6e7a7
--- /dev/null
+++ b/test/caldav/index_test.js
@@ -0,0 +1,33 @@
+if (typeof(window) !== 'undefined') {
+ testSupport.require('/caldav');
+}
+
+suite('caldav', function() {
+ var root;
+ var isNode = typeof(window) === 'undefined';
+
+ suiteSetup(function() {
+ if (isNode) {
+ root = require('../../lib/caldav');
+ } else {
+ root = Caldav;
+ }
+ });
+
+ suite('browser', function() {
+ if (isNode)
+ return;
+
+ test('sax', function() {
+ assert.ok(sax);
+ })
+ });
+
+ test('namespaces', function() {
+ assert.ok(root);
+ assert.ok(root.Request);
+ assert.ok(root.Templates);
+ assert.ok(root.Xhr);
+ });
+
+});
diff --git a/test/webcals/request/abstract_test.js b/test/caldav/request/abstract_test.js
index 37cd0f6..b63c355 100644
--- a/test/webcals/request/abstract_test.js
+++ b/test/caldav/request/abstract_test.js
@@ -1,6 +1,6 @@
requireRequest();
-suite('webcals/request/abstract.js', function() {
+suite('caldav/request/abstract.js', function() {
var subject;
var Abstract;
var Xhr;
@@ -13,10 +13,10 @@ suite('webcals/request/abstract.js', function() {
};
suiteSetup(function() {
- Abstract = Webcals.require('request/abstract');
- FakeXhr = Webcals.require('support/fake_xhr');
- Xhr = Webcals.require('xhr');
- SAX = Webcals.require('sax');
+ Abstract = Caldav.require('request/abstract');
+ FakeXhr = Caldav.require('support/fake_xhr');
+ Xhr = Caldav.require('xhr');
+ SAX = Caldav.require('sax');
oldXhrClass = Xhr.prototype.xhrClass;
Xhr.prototype.xhrClass = FakeXhr;
diff --git a/test/webcals/request/calendar_query_test.js b/test/caldav/request/calendar_query_test.js
index 4b2e556..96a95af 100644
--- a/test/webcals/request/calendar_query_test.js
+++ b/test/caldav/request/calendar_query_test.js
@@ -2,7 +2,7 @@ requireRequest();
testSupport.lib('request/propfind');
testSupport.lib('request/calendar_query');
-suite('webcals/request/calendar_query', function() {
+suite('caldav/request/calendar_query', function() {
var Propfind,
FakeXhr,
CalendarData,
@@ -17,14 +17,14 @@ suite('webcals/request/calendar_query', function() {
subject;
suiteSetup(function() {
- Propfind = Webcals.require('request/propfind');
- CalendarData = Webcals.require('templates/calendar_data');
- CalendarFilter = Webcals.require('templates/calendar_filter');
- CalendarQuery = Webcals.require('request/calendar_query');
- SaxResponse = Webcals.require('sax/dav_response');
- FakeXhr = Webcals.require('support/fake_xhr');
- Template = Webcals.require('template');
- Xhr = Webcals.require('xhr');
+ Propfind = Caldav.require('request/propfind');
+ CalendarData = Caldav.require('templates/calendar_data');
+ CalendarFilter = Caldav.require('templates/calendar_filter');
+ CalendarQuery = Caldav.require('request/calendar_query');
+ SaxResponse = Caldav.require('sax/dav_response');
+ FakeXhr = Caldav.require('support/fake_xhr');
+ Template = Caldav.require('template');
+ Xhr = Caldav.require('xhr');
oldXhrClass = Xhr.prototype.xhrClass;
Xhr.prototype.xhrClass = FakeXhr;
diff --git a/test/webcals/request/propfind_test.js b/test/caldav/request/propfind_test.js
index ea6f080..069aaf3 100644
--- a/test/webcals/request/propfind_test.js
+++ b/test/caldav/request/propfind_test.js
@@ -1,7 +1,7 @@
requireRequest();
testSupport.lib('request/propfind');
-suite('webcals/request/propfind', function() {
+suite('caldav/request/propfind', function() {
var Abstract,
Propfind,
FakeXhr,
@@ -14,12 +14,12 @@ suite('webcals/request/propfind', function() {
subject;
suiteSetup(function() {
- Abstract = Webcals.require('request/abstract');
- Propfind = Webcals.require('request/propfind');
- SaxResponse = Webcals.require('sax/dav_response');
- FakeXhr = Webcals.require('support/fake_xhr');
- Template = Webcals.require('template');
- Xhr = Webcals.require('xhr');
+ Abstract = Caldav.require('request/abstract');
+ Propfind = Caldav.require('request/propfind');
+ SaxResponse = Caldav.require('sax/dav_response');
+ FakeXhr = Caldav.require('support/fake_xhr');
+ Template = Caldav.require('template');
+ Xhr = Caldav.require('xhr');
oldXhrClass = Xhr.prototype.xhrClass;
Xhr.prototype.xhrClass = FakeXhr;
diff --git a/test/webcals/resource_root_test.js b/test/caldav/resource_root_test.js
index 4af8286..4af8286 100644
--- a/test/webcals/resource_root_test.js
+++ b/test/caldav/resource_root_test.js
diff --git a/test/webcals/sax/base_test.js b/test/caldav/sax/base_test.js
index 7ccc5da..aea5707 100644
--- a/test/webcals/sax/base_test.js
+++ b/test/caldav/sax/base_test.js
@@ -2,7 +2,7 @@ testSupport.lib('responder');
testSupport.lib('sax');
testSupport.lib('sax/base');
-suite('webcals/sax/base', function() {
+suite('caldav/sax/base', function() {
var data,
subject,
@@ -13,8 +13,8 @@ suite('webcals/sax/base', function() {
suiteSetup(function() {
- Parse = Webcals.require('sax');
- Base = Webcals.require('sax/base');
+ Parse = Caldav.require('sax');
+ Base = Caldav.require('sax/base');
});
setup(function() {
diff --git a/test/webcals/sax/dav_response_test.js b/test/caldav/sax/dav_response_test.js
index 70d1c0b..47adca0 100644
--- a/test/webcals/sax/dav_response_test.js
+++ b/test/caldav/sax/dav_response_test.js
@@ -3,7 +3,7 @@ testSupport.lib('sax/base');
testSupport.lib('sax/dav_response');
testSupport.lib('ical');
-suite('webcals/sax/dav_response', function() {
+suite('caldav/sax/dav_response', function() {
var data,
subject,
@@ -15,9 +15,9 @@ suite('webcals/sax/dav_response', function() {
suiteSetup(function() {
- Parse = Webcals.require('sax');
- Base = Webcals.require('sax/base');
- Response = Webcals.require('sax/dav_response');
+ Parse = Caldav.require('sax');
+ Base = Caldav.require('sax/base');
+ Response = Caldav.require('sax/dav_response');
});
setup(function() {
diff --git a/test/webcals/sax_test.js b/test/caldav/sax_test.js
index 0ddd4bc..8896abf 100644
--- a/test/webcals/sax_test.js
+++ b/test/caldav/sax_test.js
@@ -2,7 +2,7 @@ testSupport.lib('responder');
testSupport.lib('sax');
testSupport.lib('sax/base');
-suite('webcals/sax', function() {
+suite('caldav/sax', function() {
var data,
subject,
@@ -63,8 +63,8 @@ suite('webcals/sax', function() {
}
suiteSetup(function() {
- SAX = Webcals.require('sax');
- Base = Webcals.require('sax/base');
+ SAX = Caldav.require('sax');
+ Base = Caldav.require('sax/base');
});
setup(function() {
diff --git a/test/webcals/template_test.js b/test/caldav/template_test.js
index 75ccb6a..3853c6e 100644
--- a/test/webcals/template_test.js
+++ b/test/caldav/template_test.js
@@ -6,7 +6,7 @@ suite('templates', function() {
subject;
suiteSetup(function() {
- Template = Webcals.require('template');
+ Template = Caldav.require('template');
});
setup(function() {
diff --git a/test/webcals/templates/calendar_data_test.js b/test/caldav/templates/calendar_data_test.js
index 64b6b57..9a21926 100644
--- a/test/webcals/templates/calendar_data_test.js
+++ b/test/caldav/templates/calendar_data_test.js
@@ -1,7 +1,7 @@
requireRequest();
testSupport.lib('templates/calendar_data');
-suite('webcals/templates/calendar_data', function() {
+suite('caldav/templates/calendar_data', function() {
var CalendarData;
var Template;
@@ -17,8 +17,8 @@ suite('webcals/templates/calendar_data', function() {
}
suiteSetup(function() {
- CalendarData = Webcals.require('templates/calendar_data');
- Template = Webcals.require('template');
+ CalendarData = Caldav.require('templates/calendar_data');
+ Template = Caldav.require('template');
});
setup(function() {
diff --git a/test/webcals/templates/calendar_filter_test.js b/test/caldav/templates/calendar_filter_test.js
index 8173569..d9ce2ab 100644
--- a/test/webcals/templates/calendar_filter_test.js
+++ b/test/caldav/templates/calendar_filter_test.js
@@ -2,7 +2,7 @@ requireRequest();
testSupport.lib('templates/calendar_data');
testSupport.lib('templates/calendar_filter');
-suite('webcals/templates/calendar_filter', function() {
+suite('caldav/templates/calendar_filter', function() {
var CalendarFilter;
var Template;
@@ -14,8 +14,8 @@ suite('webcals/templates/calendar_filter', function() {
}
suiteSetup(function() {
- CalendarFilter = Webcals.require('templates/calendar_filter');
- Template = Webcals.require('template');
+ CalendarFilter = Caldav.require('templates/calendar_filter');
+ Template = Caldav.require('template');
});
setup(function() {
diff --git a/test/webcals/xhr_test.js b/test/caldav/xhr_test.js
index 1baa7b9..c442852 100644
--- a/test/webcals/xhr_test.js
+++ b/test/caldav/xhr_test.js
@@ -8,8 +8,8 @@ suite('webacls/xhr', function() {
suiteSetup(function() {
- Xhr = Webcals.require('xhr');
- FakeXhr = Webcals.require('support/fake_xhr');
+ Xhr = Caldav.require('xhr');
+ FakeXhr = Caldav.require('support/fake_xhr');
});
setup(function() {
diff --git a/test/helper.js b/test/helper.js
index fd66817..db3e162 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -102,20 +102,20 @@
};
testSupport.lib = function(lib, callback) {
- testSupport.require('/lib/webcals/' + lib, callback);
+ testSupport.require('/lib/caldav/' + lib, callback);
};
testSupport.helper = function(lib) {
testSupport.require('/test/support/' + lib);
}
- Webcals = require('../lib/webcals/webcals.js');
+ Caldav = require('../lib/caldav/caldav.js');
if (typeof(window) === 'undefined') {
- //in node we need to hack Webcals to do the right thing.
- var oldRequire = Webcals.require;
+ //in node we need to hack Caldav to do the right thing.
+ var oldRequire = Caldav.require;
- Webcals.require = function exportRequireDev(path) {
+ Caldav.require = function exportRequireDev(path) {
if (path.indexOf('support') === 0) {
path = __dirname + '/' + path;
return require(path);
diff --git a/test/support/fake_xhr.js b/test/support/fake_xhr.js
index 6c4976d..3f0c9d9 100644
--- a/test/support/fake_xhr.js
+++ b/test/support/fake_xhr.js
@@ -41,7 +41,7 @@
}.apply(
this,
- (this.Webcals) ?
- [Webcals('support/fake_xhr'), Webcals] :
- [module, require('../../lib/webcals/webcals')]
+ (this.Caldav) ?
+ [Caldav('support/fake_xhr'), Caldav] :
+ [module, require('../../lib/caldav/caldav')]
));
diff --git a/test/webcals/index_test.js b/test/webcals/index_test.js
deleted file mode 100644
index 21a770c..0000000
--- a/test/webcals/index_test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-testSupport.require('/webcals');
-
-suite('webcals', function() {
-
- test('namespaces', function() {
- assert.ok(sax);
- assert.ok(Webcals);
- assert.ok(Webcals.Request);
- assert.ok(Webcals.Templates);
- assert.ok(Webcals.Xhr);
- });
-
-});