incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [18/37] spec commit: rewriting file specs to jasmine: part 1
Date Wed, 18 Apr 2012 21:49:52 GMT
rewriting file specs to jasmine: part 1


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/commit/14c67854
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/tree/14c67854
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/diff/14c67854

Branch: refs/heads/master
Commit: 14c6785474207492595389822652fb4e95722b1f
Parents: 978151f
Author: Fil Maj <maj.fil@gmail.com>
Authored: Tue Apr 10 08:54:17 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Mon Apr 16 16:06:50 2012 -0700

----------------------------------------------------------------------
 autotest/pages/file.html        |   90 +-
 autotest/tests/compass.tests.js |    3 +-
 autotest/tests/file.tests.js    | 3060 ++++++++++++++++------------------
 3 files changed, 1514 insertions(+), 1639 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/14c67854/autotest/pages/file.html
----------------------------------------------------------------------
diff --git a/autotest/pages/file.html b/autotest/pages/file.html
index 4d13200..d437b02 100644
--- a/autotest/pages/file.html
+++ b/autotest/pages/file.html
@@ -1,54 +1,46 @@
 <!DOCTYPE html>
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes,
initial-scale=1.0;" />
-
-    <title>Cordova: File API Specs</title>
-
-    <!-- Load QUnit -->
-    <link rel="stylesheet" type="text/css" href="../qunit.css" />
-    <script type="text/javascript" src="../qunit.js"></script>
-
-    <!-- Source -->
-    <script type="text/javascript" src="../../phonegap.js"></script>
-
-    <!-- Load Test Runner -->
-    <script type="text/javascript" src="../test-runner.js"></script>
-
-    <!-- Tests -->
-    <script type="text/javascript" src="../tests/file.tests.js"></script>
-    <script type="text/javascript">
-      document.addEventListener('deviceready', function() {
-          console.log('running tests');
-          var tests = new Tests();
-
-          // Each group of tests are declared as a function in the object `Tests`.
-          // A group of tests are identified by a name that contains the word 'Tests'.
-          //
-          // Load each group of tests into QUnit
-          for (var t in tests) {
-              if (t.indexOf('Tests') > -1) {
-                  tests[t]();
-              }
-          }
-
-          // Start the QUnit test suite
-          QUnit.start();
-      }, false);
-    </script>
-  </head>
-    <body>
-        <div class="backBtn" onclick="backHome();">Back</div>
-        <h1 id="qunit-header">Cordova: File API Specs</h1>
-        <h2 id="qunit-banner"></h2>
-        <h2 id="qunit-userAgent"></h2>
-        <ol id="qunit-tests"></ol>
-        <div id="qunit-fixture">
-            <!-- Populated by tests -->
-        </div>
-    </body>
-</html>
+<head>
+  <title>Cordova: File API Specs</title>
+
+  <!-- Load jasmine -->
+  <link href="../jasmine.css" rel="stylesheet"/>
+  <script type="text/javascript" src="../jasmine.js"></script>
+  <script type="text/javascript" src="../html/HtmlReporterHelpers.js"></script>
+  <script type="text/javascript" src="../html/HtmlReporter.js"></script>
+  <script type="text/javascript" src="../html/ReporterView.js"></script>
+  <script type="text/javascript" src="../html/SpecView.js"></script>
+  <script type="text/javascript" src="../html/SuiteView.js"></script>
+  <script type="text/javascript" src="../html/TrivialReporter.js"></script>
+
+  <!-- Source -->
+  <script type="text/javascript" src="../../phonegap.js"></script>
+
+  <!-- Load Test Runner -->
+  <script type="text/javascript" src="../test-runner.js"></script>
+
+  <!-- Tests -->
+  <script type="text/javascript" src="../tests/file.tests.js"></script>
 
+  <script type="text/javascript">
+    document.addEventListener('deviceready', function () {
+      var jasmineEnv = jasmine.getEnv();
+      jasmineEnv.updateInterval = 1000;
 
+      var htmlReporter = new jasmine.HtmlReporter();
 
+      jasmineEnv.addReporter(htmlReporter);
+
+      jasmineEnv.specFilter = function(spec) {
+        return htmlReporter.specFilter(spec);
+      };
+
+      jasmineEnv.execute();
+    }, false);
+  </script>
+</head>
+
+<body>
+  <a href="javascript:" class="backBtn" onclick="backHome();">Back</a>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/14c67854/autotest/tests/compass.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/compass.tests.js b/autotest/tests/compass.tests.js
index a523a66..e8f311b 100644
--- a/autotest/tests/compass.tests.js
+++ b/autotest/tests/compass.tests.js
@@ -52,10 +52,11 @@ describe('Compass (navigator.compass)', function () {
 		    navigator.compass.getCurrentHeading(win, fail);
         });
 
-        waitsFor(function () { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT);
+        waitsFor(function () { return win.wasCalled; }, "success callback never called",
Tests.TEST_TIMEOUT);
 
         runs(function () {
             expect(fail).not.toHaveBeenCalled();
+            expect(win).toHaveBeenCalled();
         });
 <<<<<<< HEAD
 <<<<<<< HEAD


Mime
View raw message