Permalink
Browse files

Adding shortcuts for classic bdd style

  • Loading branch information...
1 parent ac91d0d commit f4ae494acf38ba55df419c6c00062941a914665f Stephen Cresswell committed Dec 25, 2012
Showing with 40 additions and 0 deletions.
  1. +21 −0 examples/classic/classic-steps.js
  2. +19 −0 examples/classic/test.html
@@ -0,0 +1,21 @@
+var steps = new Steps()
+
+.given("that I like repetitive, mechanical test specifications", function() {
+ document.write("<li>Yawn</li>");
+})
+
+.when("I use given, when, or then instead of addStep", function() {
+ document.write("<li>Stretch</li>");
+})
+
+.then("anyone reading the specification will fall asleep", function() {
+ document.write("<li>Zzzzz</li>");
+})
+
+.then("probably fall off their chair", function() {
+ document.write("<li>Bump</li>");
+})
+
+.then("not wake up", function() {
+ document.write("<li>Snore</li>");
+});
@@ -0,0 +1,19 @@
+<html>
+ <head>
+ <script src="../../src/js/yadda.js"></script>
+ <script src="./classic-steps.js"></script>
+ <script type="text/javascript">
+
+new Yadda(steps).yadda().yadda().yadda([
+ "Given that I like repetitive, mechanical test specifications",
+ "When I use given, when, or then instead of addStep",
+ "Then anyone reading the specification will fall asleep",
+ "And probably fall off their chair",
+ "But not wake up"
+]);
+ </script>
+ </head>
+ <body>
+
+ </body>
+</html>

0 comments on commit f4ae494

Please sign in to comment.