21-atom.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. (function () {
  2. function RunningInNode () {
  3. return(
  4. (typeof require) == "function"
  5. &&
  6. (typeof exports) == "object"
  7. &&
  8. (typeof module) == "object"
  9. &&
  10. (typeof __filename) == "string"
  11. &&
  12. (typeof __dirname) == "string"
  13. );
  14. }
  15. if (!RunningInNode()) {
  16. if (!this.Tautologistics)
  17. this.Tautologistics = {};
  18. if (!this.Tautologistics.NodeHtmlParser)
  19. this.Tautologistics.NodeHtmlParser = {};
  20. if (!this.Tautologistics.NodeHtmlParser.Tests)
  21. this.Tautologistics.NodeHtmlParser.Tests = [];
  22. exports = {};
  23. this.Tautologistics.NodeHtmlParser.Tests.push(exports);
  24. }
  25. exports.name = "Atom (1.0)";
  26. //http://en.wikipedia.org/wiki/Atom_%28standard%29
  27. exports.html = '<?xml version="1.0" encoding="utf-8"?>\
  28. \
  29. <feed xmlns="http://www.w3.org/2005/Atom">\
  30. \
  31. <title>Example Feed</title>\
  32. <subtitle>A subtitle.</subtitle>\
  33. <link href="http://example.org/feed/" rel="self" />\
  34. <link href="http://example.org/" />\
  35. <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>\
  36. <updated>2003-12-13T18:30:02Z</updated>\
  37. <author>\
  38. <name>John Doe</name>\
  39. <email>johndoe@example.com</email>\
  40. </author>\
  41. \
  42. <entry>\
  43. <title>Atom-Powered Robots Run Amok</title>\
  44. <link href="http://example.org/2003/12/13/atom03" />\
  45. <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>\
  46. <link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>\
  47. <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>\
  48. <updated>2003-12-13T18:30:02Z</updated>\
  49. <summary>Some text.</summary>\
  50. </entry>\
  51. \
  52. </feed>';
  53. exports.options = { };
  54. exports.type = "rss";
  55. exports.expected = {
  56. type: "atom"
  57. , id: "urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6"
  58. , title: "Example Feed"
  59. , link: "http://example.org/feed/"
  60. , description: "A subtitle."
  61. , updated: new Date("2003-12-13T18:30:02Z")
  62. , author: "johndoe@example.com"
  63. , items: [
  64. {
  65. id: "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"
  66. , title: "Atom-Powered Robots Run Amok"
  67. , link: "http://example.org/2003/12/13/atom03"
  68. , description: "Some text."
  69. , pubDate: new Date("2003-12-13T18:30:02Z")
  70. }
  71. ]
  72. };
  73. })();