Permalink
Browse files

remove old test directory, move new tests to old location

  • Loading branch information...
1 parent 9640016 commit 8a22c4069694bf44e2c32381b790d99b2563cbcb @endor endor committed Sep 3, 2012
Showing with 72 additions and 3,835 deletions.
  1. 0 {test2 → test}/application_spec.js
  2. +0 −10 test/benchmarks/template.ejs
  3. +0 −9 test/benchmarks/template.haml
  4. +0 −15 test/benchmarks/template.handlebars
  5. +0 −15 test/benchmarks/template.hogan
  6. +0 −8 test/benchmarks/template.meld
  7. +0 −15 test/benchmarks/template.mustache
  8. +0 −8 test/benchmarks/template.pure
  9. +0 −10 test/benchmarks/template.template
  10. +0 −92 test/benchmarks/templates.html
  11. 0 {test2 → test}/event_context_spec.js
  12. 0 {test2 → test}/exceptional_spec.js
  13. +1 −1 test/fixtures/list.html
  14. +1 −1 test/fixtures/partial.html
  15. 0 {test2 → test}/flash_spec.js
  16. 0 {test2 → test}/hoptoad_spec.js
  17. +70 −120 test/index.html
  18. 0 {test2 → test}/location_proxy_spec.js
  19. 0 {test2 → test}/meld_spec.js
  20. 0 {test2 → test}/plugins_spec.js
  21. 0 {test2 → test}/render_context_spec.js
  22. 0 {test2 → test}/storage_spec.js
  23. +0 −1,107 test/test_sammy_application.js
  24. +0 −245 test/test_sammy_event_context.js
  25. +0 −60 test/test_sammy_exceptional.js
  26. +0 −164 test/test_sammy_flash.js
  27. +0 −55 test/test_sammy_hoptoad.js
  28. +0 −217 test/test_sammy_location_proxy.js
  29. +0 −108 test/test_sammy_meld.js
  30. +0 −714 test/test_sammy_plugins.js
  31. +0 −407 test/test_sammy_render_context.js
  32. +0 −215 test/test_sammy_storage.js
  33. +0 −1 test2/fixtures/item.hogan
  34. +0 −1 test2/fixtures/item.mustache
  35. +0 −1 test2/fixtures/item.template
  36. +0 −1 test2/fixtures/item2.mustache
  37. +0 −1 test2/fixtures/list.html
  38. +0 −11 test2/fixtures/meld/1.html
  39. +0 −11 test2/fixtures/meld/1.json
  40. +0 −9 test2/fixtures/meld/1.meld
  41. +0 −21 test2/fixtures/meld/2.html
  42. +0 −16 test2/fixtures/meld/2.json
  43. +0 −14 test2/fixtures/meld/2.meld
  44. +0 −10 test2/fixtures/meld/3.html
  45. +0 −20 test2/fixtures/meld/3.json
  46. +0 −6 test2/fixtures/meld/3.meld
  47. +0 −1 test2/fixtures/other_partial.template
  48. +0 −1 test2/fixtures/partial
  49. +0 −1 test2/fixtures/partial.hogan
  50. +0 −1 test2/fixtures/partial.html
  51. +0 −1 test2/fixtures/partial.json
  52. +0 −1 test2/fixtures/partial.mustache
  53. +0 −1 test2/fixtures/partial.noengine
  54. +0 −1 test2/fixtures/partial.template
  55. +0 −1 test2/fixtures/partial2.mustache
  56. +0 −73 test2/index.html
  57. +0 −34 test2/test_server
File renamed without changes.
@@ -1,10 +0,0 @@
-<div class="post">
- <h2 class="title"><%= post.title %></h2>
- <div class="body"><%= post.body %></div>
- <% for (var i = 0; i < post.tags.length; i++) { %>
- <span class='tags'><%= post.tags[i] %></span>
- <% } %>
- <ul class="meta">
- <li>Comments Count: <span class="comments"><%= post.meta.comments %></span></li>
- </ul>
-</div>
@@ -1,9 +0,0 @@
-.post
- %h2.title= post.title
- .body= post.body
- :each tag in post.tags
- %span.tags= tag
- %ul.meta
- %li
- Comments Count:
- %span.comments= post.meta.comments
@@ -1,15 +0,0 @@
-{{#post}}
-<div class="post">
- <h2 class="title">{{title}}</h2>
- <div class="body">{{body}}</div>
- {{%IMPLICIT-ITERATOR iterator=tag}}
- {{#tags}}
- <span class="tags">{{tag}}</span>
- {{/tags}}
- <ul class="meta">
- {{#meta}}
- <li>Comments Count: <span class="comments">{{comments}}</span></li>
- {{/meta}}
- </ul>
-</div>
-{{/post}}
@@ -1,15 +0,0 @@
-{{#post}}
-<div class="post">
- <h2 class="title">{{title}}</h2>
- <div class="body">{{body}}</div>
- {{%IMPLICIT-ITERATOR iterator=tag}}
- {{#tags}}
- <span class="tags">{{tag}}</span>
- {{/tags}}
- <ul class="meta">
- {{#meta}}
- <li>Comments Count: <span class="comments">{{comments}}</span></li>
- {{/meta}}
- </ul>
-</div>
-{{/post}}
@@ -1,8 +0,0 @@
-<div class="post">
- <h2 class="title"></h2>
- <div class="body"></div>
- <span class="tags"></span>
- <ul class="meta">
- <li>Comments Count: <span class="comments"></span></li>
- </ul>
-</div>
@@ -1,15 +0,0 @@
-{{#post}}
-<div class="post">
- <h2 class="title">{{title}}</h2>
- <div class="body">{{body}}</div>
- {{%IMPLICIT-ITERATOR iterator=tag}}
- {{#tags}}
- <span class="tags">{{tag}}</span>
- {{/tags}}
- <ul class="meta">
- {{#meta}}
- <li>Comments Count: <span class="comments">{{comments}}</span></li>
- {{/meta}}
- </ul>
-</div>
-{{/post}}
@@ -1,8 +0,0 @@
-<div class="post">
- <h2 class="title"></h2>
- <div class="body"></div>
- <span class="tags"></span>
- <ul class="meta">
- <li>Comments Count: <span class="comments"></span></li>
- </ul>
-</div>
@@ -1,10 +0,0 @@
-<div class="post">
- <h2 class="title"><%= post.title %></h2>
- <div class="body"><%= post.body %></div>
- <% for (var i = 0; i < post.tags.length; i++) { %>
- <span class="tags"><%= post.tags[i] %></span>
- <% } %>
- <ul class="meta">
- <li>Comments Count: <span class="comments"><%= post.meta.comments %></span></li>
- </ul>
-</div>
@@ -1,92 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8">
- <title>Sammy Template Benchmarks</title>
- <script src="../../vendor/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/sammy.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.json.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.template.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.mustache.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.hogan.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.meld.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.ejs.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.pure.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.haml.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../lib/plugins/sammy.handlebars.js" type="text/javascript" charset="utf-8"></script>
-
- <script src="../../vendor/jslitmus.js" type="text/javascript" charset="utf-8"></script>
-
- </head>
- <body>
- <div id="main"></div>
- <script type="text/javascript" charset="utf-8">
- function assertSameHTML(expected, actual) {
- var strippedHTML = function(element) {
- return $(element).wrap('<div></div>').parent().html().toString().replace(/(>)(\s*)(<)/g, "><");
- };
-
- actual = strippedHTML(actual);
- expected = strippedHTML(expected);
- var assert = (actual === expected);
-
- if (!assert) {
- Sammy.log(['HTML doesnt match: expected', expected, "\n\ngot", actual].join(' '));
- }
- return assert;
- };
-
- var data = {
- post: {
- title: 'My Post',
- body: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
- tags: ['one', 'two', 'three'],
- meta: {
- comments: 5
- }
- }
- };
-
- var result = '<div class="post">' +
- '<h2 class="title">My Post</h2>' +
- '<div class="body">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>' +
- '<span class="tags">one</span>' +
- '<span class="tags">two</span>' +
- '<span class="tags">three</span>' +
- '<ul class="meta">' +
- '<li>Comments Count: <span class="comments">5</span></li>' +
- '</ul>' +
- '</div>';
-
- $.each(['Template', 'Mustache', 'Hogan', 'EJS', 'Pure', 'Haml', 'Meld', 'Handlebars'], function(i, plugin) {
- var createContext,
- template = '',
- meth = plugin.toLowerCase(),
- render_test;
- createContext = function() {
- var app = new Sammy.Application(function() {
- this.raise_errors = false;
- this.element_selector = '#main';
- this.use(Sammy[plugin], 'template');
- });
- return new app.context_prototype(app, 'get', '#/blurgh', {})
- };
- $.ajax({
- url: 'template.' + meth,
- async: false,
- success: function(response) {
- template = response;
- }
- });
- render_test = createContext().template(template, data);
- Sammy.log(plugin, render_test);
- assertSameHTML(result, render_test);
- JSLitmus.test("Render with " + plugin, function() {
- render_test = createContext().template(template, data);
- assertSameHTML(result, render_test);
- });
- });
- </script>
-
- </body>
-</html>
File renamed without changes.
File renamed without changes.
@@ -1 +1 @@
-<ul></ul>
+<ul></ul>
@@ -1 +1 @@
-<div class="test_partial">PARTIAL</div>
+<div class="test_partial">PARTIAL</div>
File renamed without changes.
File renamed without changes.
View
@@ -1,123 +1,73 @@
-<!DOCTYPE html>
<html>
-<head>
- <title>Sammy Test Suite</title>
- <link rel="stylesheet" href="../vendor/qunit/qunit.css" type="text/css" media="screen">
- <script type="text/javascript" src="../vendor/qunit/qunit.js"></script>
- <script type="text/javascript" src="../vendor/jquery.js"></script>
- <script type="text/javascript" src="../vendor/qunit-spec.js"></script>
-
- <script type="text/javascript" src="../vendor/templating/ejs.js"></script>
- <script type="text/javascript" src="../vendor/templating/haml.js"></script>
- <script type="text/javascript" src="../vendor/templating/handlebars.js"></script>
- <script type="text/javascript" src="../vendor/templating/mustache.js"></script>
- <script type="text/javascript" src="../vendor/templating/hogan.js"></script>
- <script type="text/javascript" src="../vendor/templating/pure.js"></script>
- <script type="text/javascript" src="../vendor/templating/tmpl.js"></script>
-
- <script type="text/javascript" src="../lib/sammy.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.storage.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.template.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.ejs.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.nested_params.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.mustache.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.hogan.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.handlebars.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.tmpl.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.json.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.haml.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.form.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.title.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.meld.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.pure.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.data_location_proxy.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.oauth2.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.flash.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.hoptoad.js"></script>
- <script type="text/javascript" src="../lib/plugins/sammy.exceptional.js"></script>
-
-</head>
-<body>
- <h1 id="qunit-header">Sammy Test Suite</h1>
- <h2 id="qunit-banner"></h2>
- <div id="qunit-testrunner-toolbar"></div>
- <h2 id="qunit-userAgent"></h2>
- <ol id="qunit-tests"></ol>
-
-
- <!-- Test HTML -->
- <div id="main" style="display:none;">
- <div class="get_area"></div>
- <div id="test_area"></div>
- <form id="test_form" action="#/test" method="post">
- <input type="hidden" name="test_input" value="TEST" />
-
- <input type="checkbox" name="check[]" value="TEST 1" checked="checked" />
- <input type="checkbox" name="check[]" value="TEST 2" checked="checked" />
- </form>
-
- <a id="pop" href="/">test</a>
- <a id="push" href="/push">test</a>
-
- <div class="inline-template-1"><div class="name"></div></div>
-
- <script id="script-template" type="text/html" charset="utf-8" data-engine="template">
- <div class="name"><%= name %></div>
+ <head>
+ <meta charset="utf-8">
+ <title>Mocha Tests</title>
+ <link rel="stylesheet" href="../vendor/mocha/mocha.css" />
+ <style>
+ #main {
+ display: none;
+ }
+ </style>
+ <script src="../vendor/jquery.js"></script>
+ <script src="../vendor/mocha/expect.js"></script>
+ <script src="../vendor/mocha/mocha.js"></script>
+ <script src="../vendor/mocha/helpers.js"></script>
+ <script>
+ mocha.setup({
+ ui: 'bdd',
+ ignoreLeaks: true
+ })
</script>
- </div>
- <div id="form_params" style="display:none;">
- <form id="nested_params_test_form" action="#/test_nested_params" method="post">
- <input type="text" name="author" value="Wilde" />
- <input type="text" name="author" value="Thoreau" />
- <input type="text" name="title" value="Walden%21" />
-
- <input type="text" name="genre[]" value="documentary" />
- <input type="text" name="genre[]" value="nature" />
-
- <input type="checkbox" name="truevalue" value="true" checked="checked" />
- <input type="checkbox" name="falsevalue" value="false" checked="checked" />
-
- <input type="text" name="woods[trees][][name]" value="Spruce" />
- <input type="text" name="woods[trees][][name]" value="Maple" />
-
- <input type="text" name="poll[name]" value="Which beverage do you like best?" />
- <input type="text" name="poll[priority]" value="10" />
- <input type="hidden" name="poll[options][1][id]" value="Ko5Pi" />
- <input type="text" name="poll[options][1][name]" value="Coffee" />
- <input type="hidden" name="poll[options][2][id]" value="Oaj5N" />
- <input type="text" name="poll[options][2][name]" value="Tea" />
-
- <input type="text" name="poll[options][1][ingredients][]" value="Water" />
- <input type="text" name="poll[options][1][ingredients][]" value="Coffein" />
- <input type="text" name="pages[][words][]" value="Woods" />
- <input type="text" name="pages[][words][]" value="Money" />
-
- <input type="text" name="music[instruments][][name]" value="Piano" />
- <input type="text" name="music[instruments][][size]" value="big" />
- <input type="text" name="music[instruments][][name]" value="Flute" />
- <input type="text" name="music[instruments][][size]" value="small" />
- </form>
-
- <form id="bad_nested_params_form" action="#/bad_nested_params" method="post">
- <!-- these produce bad request errors -->
- <input type="text" name="woods[trees][]name" value="Oak" />
- <input type="text" name="softdrinks[]" value="Pepsi" />
- <input type="text" name="softdrinks[name]" value="Cola" />
- <input type="text" name="beverages[wine]" value="Cuvee du Vatican" />
- <input type="text" name="beverages[wine][][name]" value="Fleurie" />
- </form>
- </div>
-
- <script type="text/javascript" src="test_sammy_application.js"></script>
- <script type="text/javascript" src="test_sammy_event_context.js"></script>
- <script type="text/javascript" src="test_sammy_render_context.js"></script>
- <script type="text/javascript" src="test_sammy_location_proxy.js"></script>
- <script type="text/javascript" src="test_sammy_plugins.js"></script>
- <script type="text/javascript" src="test_sammy_flash.js"></script>
- <script type="text/javascript" src="test_sammy_meld.js"></script>
- <script type="text/javascript" src="test_sammy_storage.js"></script>
- <script type="text/javascript" src="test_sammy_hoptoad.js"></script>
- <script type="text/javascript" src="test_sammy_exceptional.js"></script>
-</body>
-</html>
+ <script type="text/javascript" src="../vendor/templating/mustache.js"></script>
+ <script type="text/javascript" src="../vendor/templating/ejs.js"></script>
+ <script type="text/javascript" src="../vendor/templating/hogan.js"></script>
+ <script type="text/javascript" src="../vendor/templating/handlebars.js"></script>
+ <script type="text/javascript" src="../vendor/templating/pure.js"></script>
+ <script type="text/javascript" src="../vendor/templating/haml.js"></script>
+ <script type="text/javascript" src="../vendor/templating/tmpl.js"></script>
+
+ <script src="../lib/sammy.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.exceptional.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.hoptoad.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.flash.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.template.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.mustache.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.meld.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.data_location_proxy.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.json.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.storage.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.cache.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.ejs.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.haml.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.hogan.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.handlebars.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.pure.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.tmpl.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.nested_params.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.form.js"></script>
+ <script type="text/javascript" src="../lib/plugins/sammy.oauth2.js"></script>
+
+ <script src="application_spec.js"></script>
+ <script src="event_context_spec.js"></script>
+ <script src="exceptional_spec.js"></script>
+ <script src="flash_spec.js"></script>
+ <script src="location_proxy_spec.js"></script>
+ <script src="meld_spec.js"></script>
+ <script src="render_context_spec.js"></script>
+ <script src="storage_spec.js"></script>
+ <script src="plugins_spec.js"></script>
+ <script src="hoptoad_spec.js"></script>
+
+ <script>
+ $(function() {
+ mocha.run();
+ });
+ </script>
+ </head>
+ <body>
+ <div id="mocha"></div>
+ <div id="main"></div>
+ <div id="main2"></div>
+ </body>
+</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit 8a22c40

Please sign in to comment.