forked from danmactough/node-feedparser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnondefaultNamespaces-04.js
45 lines (43 loc) · 1.47 KB
/
nondefaultNamespaces-04.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
describe('feedparser', function(){
var feedparser = new FeedParser({silent: true})
, feed = __dirname + '/feeds/nondefaultnamespace-xhtml.atom'
, meta = {}
, articles = {}
;
describe('nondefaultnamespace Test case 2: default namespace Atom; XHTML namespace mapped to a prefix', function(){
before(function(done){
feedparser.parseFile(feed, function (error, _meta, _articles) {
assert.ifError(error);
meta = _meta;
articles = _articles;
done();
});
});
describe('article', function(){
it('should have the expected title', function() {
assert.ok(articles[0].title.match(/^If you can read/));
});
it('should have the expected description', function(){
assert.ok(articles[0].description.match(/^<h:div>/));
});
});
});
describe('nondefaultnamespace using static methods Test case 2: default namespace Atom; XHTML namespace mapped to a prefix', function(){
before(function(done){
FeedParser.parseFile(feed, function (error, _meta, _articles) {
assert.ifError(error);
meta = _meta;
articles = _articles;
done();
});
});
describe('article', function(){
it('should have the expected title', function() {
assert.ok(articles[0].title.match(/^If you can read/));
});
it('should have the expected description', function(){
assert.ok(articles[0].description.match(/^<h:div>/));
});
});
});
});