Permalink
Browse files

adding local versions of the practicals, update references

  • Loading branch information...
1 parent 123f753 commit 8c026f909bc921649158a5a6766117b0315b005d @addyosmani committed Mar 10, 2012
Showing with 73,535 additions and 8 deletions.
  1. +4 −8 README.md
  2. +23 −0 practicals/jasmine-koans/README.md
  3. +2,467 −0 practicals/jasmine-koans/css/bootstrap.css
  4. +15 −0 practicals/jasmine-koans/css/koansReporter.css
  5. +311 −0 practicals/jasmine-koans/css/todos.css
  6. BIN practicals/jasmine-koans/images/destroy.png
  7. +39 −0 practicals/jasmine-koans/index.html
  8. +1,158 −0 practicals/jasmine-koans/js/ext/backbone.js
  9. +97 −0 practicals/jasmine-koans/js/ext/backbone.localStorage.js
  10. +190 −0 practicals/jasmine-koans/js/ext/jasmine-html.js
  11. +166 −0 practicals/jasmine-koans/js/ext/jasmine.css
  12. +2,476 −0 practicals/jasmine-koans/js/ext/jasmine.js
  13. +9,046 −0 practicals/jasmine-koans/js/ext/jquery.js
  14. +36 −0 practicals/jasmine-koans/js/ext/template.js
  15. +931 −0 practicals/jasmine-koans/js/ext/underscore.js
  16. +42 −0 practicals/jasmine-koans/js/koans/aboutCollections.js
  17. +97 −0 practicals/jasmine-koans/js/koans/aboutEvents.js
  18. +51 −0 practicals/jasmine-koans/js/koans/aboutModels.js
  19. +61 −0 practicals/jasmine-koans/js/koans/aboutViews.js
  20. +3 −0 practicals/jasmine-koans/js/koans/finalSteps.js
  21. +132 −0 practicals/jasmine-koans/js/koansReporter.js
  22. +210 −0 practicals/jasmine-koans/js/todos.js
  23. +40 −0 practicals/jasmine-koans/specrunner.html
  24. +18 −0 practicals/jasmine-koans/templates/app.html
  25. +10 −0 practicals/jasmine-koans/templates/item.html
  26. +14 −0 practicals/jasmine-koans/templates/stats.html
  27. +115 −0 practicals/jasmine-koans/tooterApp.js
  28. +2,467 −0 practicals/qunit-koans/css/bootstrap.css
  29. +15 −0 practicals/qunit-koans/css/koansReporter.css
  30. +311 −0 practicals/qunit-koans/css/todos.css
  31. BIN practicals/qunit-koans/images/destroy.png
  32. +43 −0 practicals/qunit-koans/index.html
  33. +1,158 −0 practicals/qunit-koans/js/ext/backbone.js
  34. +104 −0 practicals/qunit-koans/js/ext/backbone.localStorage.js
  35. +9,046 −0 practicals/qunit-koans/js/ext/jquery.js
  36. +36 −0 practicals/qunit-koans/js/ext/template.js
  37. +931 −0 practicals/qunit-koans/js/ext/underscore.js
  38. +31 −0 practicals/qunit-koans/js/koans/aboutApps.js
  39. +63 −0 practicals/qunit-koans/js/koans/aboutCollections.js
  40. +166 −0 practicals/qunit-koans/js/koans/aboutEvents.js
  41. +67 −0 practicals/qunit-koans/js/koans/aboutModels.js
  42. +64 −0 practicals/qunit-koans/js/koans/aboutViews.js
  43. +210 −0 practicals/qunit-koans/js/todos.js
  44. +43 −0 practicals/qunit-koans/specrunner.html
  45. +18 −0 practicals/qunit-koans/templates/app.html
  46. +10 −0 practicals/qunit-koans/templates/item.html
  47. +14 −0 practicals/qunit-koans/templates/stats.html
  48. +116 −0 practicals/stacks/README.md
  49. +89 −0 practicals/stacks/option1/app.js
  50. +5 −0 practicals/stacks/option1/install.sh
  51. +38 −0 practicals/stacks/option1/public/404.html
  52. +25 −0 practicals/stacks/option1/public/crossdomain.xml
  53. +444 −0 practicals/stacks/option1/public/css/style.css
  54. BIN practicals/stacks/option1/public/favicon.ico
  55. +43 −0 practicals/stacks/option1/public/humans.txt
  56. +2 −0 practicals/stacks/option1/public/img/.gitignore
  57. BIN practicals/stacks/option1/public/img/destroy.png
  58. +8,981 −0 practicals/stacks/option1/public/js/libs/jquery-1.6.2.js
  59. +18 −0 practicals/stacks/option1/public/js/libs/jquery-1.6.2.min.js
  60. +4 −0 practicals/stacks/option1/public/js/libs/modernizr-2.0.6.min.js
  61. +2 −0 practicals/stacks/option1/public/js/mylibs/.gitignore
  62. +33 −0 practicals/stacks/option1/public/js/mylibs/backbone-min.js
  63. +1,158 −0 practicals/stacks/option1/public/js/mylibs/backbone.js
  64. +29 −0 practicals/stacks/option1/public/js/mylibs/underscore-min.js
  65. +931 −0 practicals/stacks/option1/public/js/mylibs/underscore.js
  66. +5 −0 practicals/stacks/option1/public/js/plugins.js
  67. +233 −0 practicals/stacks/option1/public/js/script.js
  68. +5 −0 practicals/stacks/option1/public/robots.txt
  69. +105 −0 practicals/stacks/option1/public/static.html
  70. +31 −0 practicals/stacks/option1/public/test/index.html
  71. +148 −0 practicals/stacks/option1/public/test/qunit/qunit.css
  72. +1,265 −0 practicals/stacks/option1/public/test/qunit/qunit.js
  73. +27 −0 practicals/stacks/option1/public/test/tests.js
  74. +89 −0 practicals/stacks/option2/app.js
  75. +5 −0 practicals/stacks/option2/install.sh
  76. +38 −0 practicals/stacks/option2/public/404.html
  77. +25 −0 practicals/stacks/option2/public/crossdomain.xml
  78. +444 −0 practicals/stacks/option2/public/css/style.css
  79. BIN practicals/stacks/option2/public/favicon.ico
  80. +43 −0 practicals/stacks/option2/public/humans.txt
  81. +2 −0 practicals/stacks/option2/public/img/.gitignore
  82. BIN practicals/stacks/option2/public/img/destroy.png
  83. +8,981 −0 practicals/stacks/option2/public/js/libs/jquery-1.6.2.js
  84. +18 −0 practicals/stacks/option2/public/js/libs/jquery-1.6.2.min.js
  85. +4 −0 practicals/stacks/option2/public/js/libs/modernizr-2.0.6.min.js
  86. +2 −0 practicals/stacks/option2/public/js/mylibs/.gitignore
  87. +33 −0 practicals/stacks/option2/public/js/mylibs/backbone-min.js
  88. +1,158 −0 practicals/stacks/option2/public/js/mylibs/backbone.js
  89. +29 −0 practicals/stacks/option2/public/js/mylibs/underscore-min.js
  90. +931 −0 practicals/stacks/option2/public/js/mylibs/underscore.js
  91. +5 −0 practicals/stacks/option2/public/js/plugins.js
  92. +234 −0 practicals/stacks/option2/public/js/script.js
  93. +5 −0 practicals/stacks/option2/public/robots.txt
  94. +31 −0 practicals/stacks/option2/public/test/index.html
  95. +148 −0 practicals/stacks/option2/public/test/qunit/qunit.css
  96. +1,265 −0 practicals/stacks/option2/public/test/qunit/qunit.js
  97. +27 −0 practicals/stacks/option2/public/test/tests.js
  98. +52 −0 practicals/stacks/option2/views/layout.jade
  99. +40 −0 practicals/stacks/option2/views/todo.jade
  100. +7 −0 practicals/stacks/option3/Gemfile
  101. +75 −0 practicals/stacks/option3/README.md
  102. +38 −0 practicals/stacks/option3/app.rb
  103. +5 −0 practicals/stacks/option3/install.sh
  104. +38 −0 practicals/stacks/option3/public/404.html
  105. +25 −0 practicals/stacks/option3/public/crossdomain.xml
  106. +444 −0 practicals/stacks/option3/public/css/style.css
  107. BIN practicals/stacks/option3/public/favicon.ico
  108. +43 −0 practicals/stacks/option3/public/humans.txt
  109. +2 −0 practicals/stacks/option3/public/img/.gitignore
  110. BIN practicals/stacks/option3/public/img/destroy.png
  111. +8,981 −0 practicals/stacks/option3/public/js/libs/jquery-1.6.2.js
  112. +18 −0 practicals/stacks/option3/public/js/libs/jquery-1.6.2.min.js
  113. +4 −0 practicals/stacks/option3/public/js/libs/modernizr-2.0.6.min.js
  114. +2 −0 practicals/stacks/option3/public/js/mylibs/.gitignore
  115. +33 −0 practicals/stacks/option3/public/js/mylibs/backbone-min.js
  116. +1,158 −0 practicals/stacks/option3/public/js/mylibs/backbone.js
  117. +29 −0 practicals/stacks/option3/public/js/mylibs/underscore-min.js
  118. +931 −0 practicals/stacks/option3/public/js/mylibs/underscore.js
  119. +5 −0 practicals/stacks/option3/public/js/plugins.js
  120. +235 −0 practicals/stacks/option3/public/js/script.js
  121. +5 −0 practicals/stacks/option3/public/robots.txt
  122. +31 −0 practicals/stacks/option3/public/test/index.html
  123. +148 −0 practicals/stacks/option3/public/test/qunit/qunit.css
  124. +1,265 −0 practicals/stacks/option3/public/test/qunit/qunit.js
  125. +27 −0 practicals/stacks/option3/public/test/tests.js
  126. +1 −0 practicals/stacks/option3/views/index.haml
  127. +48 −0 practicals/stacks/option3/views/layout.haml
  128. +42 −0 practicals/stacks/option3/views/todo.haml
View
@@ -1258,7 +1258,7 @@ Jade is a template engine influenced by Haml (which we'll be looking at later).
###Practical
-For this practical, we're going to once again look at extending the popular Backbone Todo application. Rather than relying on localStorage for data persistence, we're going to switch to storing Todos in a MongoDB document-store instead. The code for this practical can be found at: https://github.com/addyosmani/backbone-boilerplates/tree/master/option2
+For this practical, we're going to once again look at extending the popular Backbone Todo application. Rather than relying on localStorage for data persistence, we're going to switch to storing Todos in a MongoDB document-store instead. The code for this practical can be found in `practicals\stacks\option2`
**app.js**
@@ -3045,10 +3045,7 @@ And finally the sources being tested:
##TDD With Backbone
-When developing applications with Backbone, it can be necessary to test both individual modules of code as well as modules, views, collections and routers. Taking a TDD approach to testing, let's review some specs for testing these Backbone components using the popular Backbone [Todo](https://github.com/addyosmani/todomvc/tree/master/todo-example/backbone) application.
-
-I would like to extend my thanks to Larry Myers for his [Koans](https://github.com/addyosmani/backbone-koans) project which both greatly helped here and will be used in the exercise portion of this chapter.
-
+When developing applications with Backbone, it can be necessary to test both individual modules of code as well as modules, views, collections and routers. Taking a TDD approach to testing, let's review some specs for testing these Backbone components using the popular Backbone [Todo](https://github.com/addyosmani/todomvc/tree/master/todo-example/backbone) application. For this section we will be using a modified version of Larry Myers Backbone Koans project, which can be found in the `practicals\jasmine-koans` folder.
##<a name="testing-jasmine-models">Models</a>
@@ -3654,9 +3651,8 @@ James Newbery was kind enough to help me with writing the Views section above an
##Exercise
-As an exercise, I recommend now downloading [Backbone Koans](http://github.com/addyosmani/backbone-koans) and trying to fix some of the purposefully failing tests it has to offer. This is an excellent way of not just learning how Jasmine specs and suites work, but working through the examples (without peaking back) will also put your Backbone skills to test too.
+As an exercise, I recommend now trying the Jasmine Koans in `practicals\jasmine-joans` and trying to fix some of the purposefully failing tests it has to offer. This is an excellent way of not just learning how Jasmine specs and suites work, but working through the examples (without peaking back) will also put your Backbone skills to test too.
-**Note**: I've linked to this book's fork of Koans in case any project-specific changes are required, however, in case you would like to check out the original project on GitHub, please feel [free](https://github.com/larrymyers/backbone-koans) to.
##Further reading
* [Jasmine + Backbone Revisited](http://japhr.blogspot.com/2011/11/jasmine-backbonejs-revisited.html)
@@ -4355,7 +4351,7 @@ Practical
We can now begin writing test specs for our Todo application, which are listed and separated by component (e.g Models, Collections etc.). It's useful to pay attention to the name of the test, the logic being tested and most importantly the assertions being made as this will give you some insight into how what we've learned can be applied to a complete application.
-To get the most out of this section, I recommend grabbing <https://github.com/addyosmani/backbone-koans-qunit> - this is a port of the Backbone.js Jasmine Koans over to QUnit that I converted for this post.
+To get the most out of this section, I recommend looking at the QUnit Koans included in the `practicals\qunit-koans` folder - this is a port of the Backbone.js Jasmine Koans over to QUnit that I converted for this post.
*In case you haven't had a chance to try out one of the Koans kits as yet, they are a set of unit tests using a specific testing framework that both demonstrate how a set of specs for an application may be written, but also leave some tests unfilled so that you can complete them as an exercise.*
@@ -0,0 +1,23 @@
+# Backbone Koans
+
+A set of jasmine powered koans for learning [Backbone.js](http://http://documentcloud.github.com/backbone).
+
+The koans verify behavior of a Todo list app, a modified version of the original Todos app
+created by [Jérôme Gravel-Niquet](http://jgn.me/).
+
+## How to Run
+
+ cp -R js/koans koans
+
+This gets you a fresh set of failing specs to start with.
+
+Open your favorite browser, and load the specrunner.html file. You should see many failing specs.
+
+If you have python on your machine, here's an easy way to do that:
+
+ python -m SimpleHTTPServer
+ http://localhost:8000/
+
+Work your way through the jasmine specs in the koans/ directory, and when you finish you should have
+a better understanding of how to create and test a Backbone app.
+
Oops, something went wrong.

0 comments on commit 8c026f9

Please sign in to comment.