cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgreb...@apache.org
Subject [07/13] CB-6481 Updated tests
Date Fri, 26 Sep 2014 21:20:06 GMT
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/fixtures/projWithHooks/www/css/index.css
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/projWithHooks/www/css/index.css b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/css/index.css
new file mode 100644
index 0000000..51daa79
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/css/index.css
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+* {
+    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust
last value opacity 0 to 1.0 */
+}
+
+body {
+    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when
tap to hold */
+    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit
*/
+    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none'
to 'text' */
+    background-color:#E4E4E4;
+    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        color-stop(0, #A7A7A7),
+        color-stop(0.51, #E4E4E4)
+    );
+    background-attachment:fixed;
+    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+    font-size:12px;
+    height:100%;
+    margin:0px;
+    padding:0px;
+    text-transform:uppercase;
+    width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+    position:absolute;             /* position in the center of the screen */
+    left:50%;
+    top:50%;
+    height:50px;                   /* text area height */
+    width:225px;                   /* text area width */
+    text-align:center;
+    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with
text) */
+    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area
height */
+                                   /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+    .app {
+        background-position:left center;
+        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image
height */
+        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
+                                      /* offset horizontal: half of image width and text
area width */
+    }
+}
+
+h1 {
+    font-size:24px;
+    font-weight:normal;
+    margin:0px;
+    overflow:visible;
+    padding:0px;
+    text-align:center;
+}
+
+.event {
+    border-radius:4px;
+    -webkit-border-radius:4px;
+    color:#FFFFFF;
+    font-size:12px;
+    margin:0px 30px;
+    padding:2px 0px;
+}
+
+.event.listening {
+    background-color:#333333;
+    display:block;
+}
+
+.event.received {
+    background-color:#4B946A;
+    display:none;
+}
+
+@keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+@-webkit-keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+.blink {
+    animation:fade 3000ms infinite;
+    -webkit-animation:fade 3000ms infinite;
+}

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/fixtures/projWithHooks/www/img/logo.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/projWithHooks/www/img/logo.png b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/img/logo.png
differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/fixtures/projWithHooks/www/index.html
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/projWithHooks/www/index.html b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/index.html
new file mode 100644
index 0000000..bde5741
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/index.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+     KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<html>
+    <head>
+        <meta charset="utf-8" />
+        <meta name="format-detection" content="telephone=no" />
+        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height
attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
+        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1,
minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
+        <link rel="stylesheet" type="text/css" href="css/index.css" />
+        <title>Hello World</title>
+    </head>
+    <body>
+        <div class="app">
+            <h1>Apache Cordova</h1>
+            <div id="deviceready" class="blink">
+                <p class="event listening">Connecting to Device</p>
+                <p class="event received">Device is Ready</p>
+            </div>
+        </div>
+        <script type="text/javascript" src="cordova.js"></script>
+        <script type="text/javascript" src="js/index.js"></script>
+        <script type="text/javascript">
+            app.initialize();
+        </script>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/fixtures/projWithHooks/www/js/index.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/projWithHooks/www/js/index.js b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/js/index.js
new file mode 100644
index 0000000..31d9064
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/js/index.js
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+var app = {
+    // Application Constructor
+    initialize: function() {
+        this.bindEvents();
+    },
+    // Bind Event Listeners
+    //
+    // Bind any events that are required on startup. Common events are:
+    // 'load', 'deviceready', 'offline', and 'online'.
+    bindEvents: function() {
+        document.addEventListener('deviceready', this.onDeviceReady, false);
+    },
+    // deviceready Event Handler
+    //
+    // The scope of 'this' is the event. In order to call the 'receivedEvent'
+    // function, we must explicity call 'app.receivedEvent(...);'
+    onDeviceReady: function() {
+        app.receivedEvent('deviceready');
+    },
+    // Update DOM on a Received Event
+    receivedEvent: function(id) {
+        var parentElement = document.getElementById(id);
+        var listeningElement = parentElement.querySelector('.listening');
+        var receivedElement = parentElement.querySelector('.received');
+
+        listeningElement.setAttribute('style', 'display:none;');
+        receivedElement.setAttribute('style', 'display:block;');
+
+        console.log('Received Event: ' + id);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/fixtures/projWithHooks/www/spec.html
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/projWithHooks/www/spec.html b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/spec.html
new file mode 100644
index 0000000..71f00de
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/projWithHooks/www/spec.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+     KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<html>
+    <head>
+        <title>Jasmine Spec Runner</title>
+
+        <!-- jasmine source -->
+        <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png">
+        <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css">
+        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script>
+        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script>
+
+        <!-- include source files here... -->
+        <script type="text/javascript" src="js/index.js"></script>
+
+        <!-- include spec files here... -->
+        <script type="text/javascript" src="spec/helper.js"></script>
+        <script type="text/javascript" src="spec/index.js"></script>
+
+        <script type="text/javascript">
+            (function() {
+                var jasmineEnv = jasmine.getEnv();
+                jasmineEnv.updateInterval = 1000;
+
+                var htmlReporter = new jasmine.HtmlReporter();
+
+                jasmineEnv.addReporter(htmlReporter);
+
+                jasmineEnv.specFilter = function(spec) {
+                    return htmlReporter.specFilter(spec);
+                };
+
+                var currentWindowOnload = window.onload;
+
+                window.onload = function() {
+                    if (currentWindowOnload) {
+                        currentWindowOnload();
+                    }
+                    execJasmine();
+                };
+
+                function execJasmine() {
+                    jasmineEnv.execute();
+                }
+            })();
+        </script>
+    </head>
+    <body>
+        <div id="stage" style="display:none;"></div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/hooker.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/hooker.spec.js b/cordova-lib/spec-cordova/hooker.spec.js
deleted file mode 100644
index 3696cb1..0000000
--- a/cordova-lib/spec-cordova/hooker.spec.js
+++ /dev/null
@@ -1,261 +0,0 @@
- /**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-**/
-
-
-var cordova = require('../src/cordova/cordova'),
-    hooker = require('../src/cordova/hooker'),
-    shell  = require('shelljs'),
-    path   = require('path'),
-    fs     = require('fs'),
-    os     = require('os'),
-    Q      = require('q'),
-    child_process = require('child_process'),
-    helpers = require('./helpers');
-
-var platform = os.platform();
-var tmpDir = helpers.tmpDir('hooks_test');
-var project = path.join(tmpDir, 'project');
-var dotCordova = path.join(project, '.cordova');
-var hooksDir = path.join(project, '.cordova', 'hooks');
-var ext = platform.match(/(win32|win64)/)?'bat':'sh';
-
-
-// copy fixture
-shell.rm('-rf', project);
-shell.mkdir('-p', project);
-shell.cp('-R', path.join(__dirname, 'fixtures', 'base', '*'), project);
-shell.mkdir('-p', dotCordova);
-shell.cp('-R', path.join(__dirname, 'fixtures', 'hooks_' + ext), dotCordova);
-shell.mv(path.join(dotCordova, 'hooks_' + ext), hooksDir);
-shell.chmod('-R', 'ug+x', hooksDir);
-
-
-describe('hooker', function() {
-    it('should throw if provided directory is not a cordova project', function() {
-        expect(function() {
-            new hooker(tmpDir);
-        }).toThrow();
-    });
-});
-
-describe('global (static) fire method', function() {
-    it('should execute listeners serially', function(done) {
-        var test_event = 'foo';
-        var h1_fired = false;
-        var h1 = function() {
-            expect(h2_fired).toBe(false);
-            // Delay 100 ms here to check that h2 is not executed until after
-            // the promise returned by h1 is resolved.
-            var q = Q.delay(100).then(function() {
-                h1_fired = true;
-            });
-            return q;
-        };
-        var h2_fired = false;
-        var h2 = function() {
-            h2_fired = true;
-            expect(h1_fired).toBe(true);
-            return Q();
-        };
-
-        cordova.on(test_event, h1);
-        cordova.on(test_event, h2);
-        hooker.fire(test_event).then(function() {
-            expect(h1_fired).toBe(true);
-            expect(h2_fired).toBe(true);
-            done();
-        });
-    });
-});
-
-describe('module-level hooks', function() {
-    var handler = jasmine.createSpy().andReturn(Q());
-    var test_event = 'before_build';
-    var h;
-
-    beforeEach(function() {
-        h = new hooker(project);
-    });
-
-    afterEach(function() {
-        cordova.removeAllListeners(test_event);
-        handler.reset();
-    });
-
-    it('should fire handlers using cordova.on', function(done) {
-        cordova.on(test_event, handler);
-        h.fire(test_event)
-        .then(function() {
-            expect(handler).toHaveBeenCalled();
-        })
-        .fail(function(err) {
-            expect(err).not.toBeDefined();
-        })
-        .fin(done);
-    });
-
-    it('should pass the project root folder as parameter into the module-level handlers',
function(done) {
-        cordova.on(test_event, handler);
-        h.fire(test_event)
-        .then(function() {
-            expect(handler).toHaveBeenCalledWith({root:project});
-        })
-        .fail(function(err) {
-            console.log(err);
-            expect(err).not.toBeDefined();
-        })
-        .fin(done);
-    });
-
-    it('should be able to stop listening to events using cordova.off', function(done) {
-        cordova.on(test_event, handler);
-        cordova.off(test_event, handler);
-        h.fire(test_event)
-        .then(function() {
-            expect(handler).not.toHaveBeenCalled();
-        })
-        .fail(function(err) {
-            console.log(err);
-            expect(err).toBeUndefined();
-        })
-        .fin(done);
-    });
-
-    it('should allow for hook to opt into asynchronous execution and block further hooks
from firing using the done callback', function(done) {
-        var h1_fired = false;
-        var h1 = function() {
-            h1_fired = true;
-            expect(h2_fired).toBe(false);
-            return Q();
-        };
-        var h2_fired = false;
-        var h2 = function() {
-            h2_fired = true;
-            expect(h1_fired).toBe(true);
-            return Q();
-        };
-
-        cordova.on(test_event, h1);
-        cordova.on(test_event, h2);
-        h.fire(test_event).then(function() {
-            expect(h1_fired).toBe(true);
-            expect(h2_fired).toBe(true);
-            done();
-        });
-    });
-
-    it('should pass data object that fire calls into async handlers', function(done) {
-        var data = {
-            "hi":"ho",
-            "offtowork":"wego"
-        };
-        var async = function(opts) {
-            data.root = tmpDir;
-            expect(opts).toEqual(data);
-            return Q();
-        };
-        cordova.on(test_event, async);
-        h.fire(test_event, data).then(done);
-    });
-
-    it('should pass data object that fire calls into sync handlers', function(done) {
-        var data = {
-            "hi":"ho",
-            "offtowork":"wego"
-        };
-        var async = function(opts) {
-            data.root = tmpDir;
-            expect(opts).toEqual(data);
-        };
-        cordova.on(test_event, async);
-        h.fire(test_event, data).then(done);
-    });
-});
-
-
-describe('hooks', function() {
-    var h;
-    beforeEach(function() {
-        h = new hooker(project);
-    });
-
-
-    it('should not error if the hook is unrecognized', function(done) {
-        h.fire('CLEAN YOUR SHORTS GODDAMNIT LIKE A BIG BOY!')
-        .fail(function (err) {
-            expect('Call with unrecogized hook ').toBe('successful.\n' + err);
-        })
-        .fin(done);
-    });
-
-    it('should error if any script exits with non-zero code', function(done) {
-        h.fire('fail').then(function() {
-            expect('the call').toBe('a failure');
-        }, function(err) {
-            expect(err).toBeDefined();
-        })
-        .fin(done);
-    });
-
-    it('should execute all scripts in order', function(done) {
-        h.fire('test')
-        .then(function() {
-            var hooksOrderFile = path.join(project, 'hooks_order.txt');
-            var hooksEnvFile = path.join(project, 'hooks_env.json');
-            var hooksParamsFile = path.join(project, 'hooks_params.txt');
-            expect(hooksOrderFile).toExist();
-            expect(hooksEnvFile).toExist();
-            expect(hooksParamsFile).toExist();
-            expect(path.join(project, 'dotted_hook_should_not_fire.txt')).not.toExist();
-
-            var order = fs.readFileSync(hooksOrderFile, 'ascii').replace(/\W/gm, '');
-            expect(order).toBe('ab');
-
-            var params = fs.readFileSync(hooksParamsFile, 'ascii').trim().trim('"');
-            expect(params).toMatch(project.replace(/\\/g, '\\\\'));
-
-            var env = JSON.parse(fs.readFileSync(hooksEnvFile, 'ascii'));
-            expect(env.CORDOVA_VERSION).toEqual(require('../package').version);
-        })
-        .fail(function(err) {
-            console.log(err);
-            expect('Test hook call').toBe('successful');
-        })
-        .fin(done);
-
-    });
-
-    // Cleanup. Must be the last spec. Is there a better place for final cleanup in Jasmine?
-    it('should not fail during cleanup', function() {
-        process.chdir(path.join(__dirname, '..'));  // Non e2e tests assume CWD is repo root.
-        if(ext == 'sh') {
-            //shell.rm('-rf', tmpDir);
-        } else { // Windows:
-            // For some mysterious reason, both shell.rm and RMDIR /S /Q won't
-            // delete the dir on Windows, but they do remove the files leaving
-            // only folders. But the dir is removed just fine by
-            // shell.rm('-rf', tmpDir) at the top of this file with the next
-            // invocation of this test. The benefit of RMDIR /S /Q is that it
-            // doesn't print warnings like shell.rmdir() that look like this:
-            // rm: could not remove directory (code ENOTEMPTY): C:\Users\...
-            var cmd =  'RMDIR /S /Q ' + tmpDir;
-            child_process.exec(cmd);
-        }
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/lazy_load.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/lazy_load.spec.js b/cordova-lib/spec-cordova/lazy_load.spec.js
index 72a26bf..f62f4c6 100644
--- a/cordova-lib/spec-cordova/lazy_load.spec.js
+++ b/cordova-lib/spec-cordova/lazy_load.spec.js
@@ -22,7 +22,7 @@ var lazy_load = require('../src/cordova/lazy_load'),
     shell = require('shelljs'),
     npmconf = require('npmconf');
     path = require('path'),
-    hooker = require('../src/cordova/hooker'),
+    HooksRunner = require('../src/hooks/HooksRunner'),
     request = require('request'),
     fs = require('fs'),
     Q = require('q'),
@@ -78,7 +78,7 @@ describe('lazy_load module', function() {
             mv = spyOn(shell, 'mv');
             exists = spyOn(fs, 'existsSync').andReturn(false);
             readdir = spyOn(fs, 'readdirSync').andReturn(['somefile.txt']);
-            fire = spyOn(hooker, 'fire').andReturn(Q());
+            fire = spyOn(HooksRunner, 'fire').andReturn(Q());
         });
 
         it('should callback with no errors and not fire event hooks if library already exists',
function(done) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/prepare.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/prepare.spec.js b/cordova-lib/spec-cordova/prepare.spec.js
index 475b90e..44d16b2 100644
--- a/cordova-lib/spec-cordova/prepare.spec.js
+++ b/cordova-lib/spec-cordova/prepare.spec.js
@@ -26,7 +26,7 @@ var cordova = require('../src/cordova/cordova'),
     lazy_load = require('../src/cordova/lazy_load'),
     ConfigParser = require('../src/configparser/ConfigParser'),
     platforms = require('../src/cordova/platforms'),
-    hooker = require('../src/cordova/hooker'),
+    HooksRunner = require('../src/hooks/HooksRunner'),
     xmlHelpers = require('../src/util/xml-helpers'),
     fixtures = path.join(__dirname, 'fixtures'),
     et = require('elementtree'),
@@ -71,7 +71,7 @@ describe('prepare command', function() {
         is_cordova = spyOn(util, 'isCordova').andReturn(project_dir);
         cd_project_root = spyOn(util, 'cdProjectRoot').andReturn(project_dir);
         list_platforms = spyOn(util, 'listPlatforms').andReturn(supported_platforms);
-        fire = spyOn(hooker.prototype, 'fire').andReturn(Q());
+        fire = spyOn(HooksRunner.prototype, 'fire').andReturn(Q());
         supported_platforms.forEach(function(p) {
             parsers[p] = jasmine.createSpy(p + ' update_project').andReturn(Q());
             spyOn(platforms[p], 'parser').andReturn({

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/run.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/run.spec.js b/cordova-lib/spec-cordova/run.spec.js
index ec33f0f..7234a6d 100644
--- a/cordova-lib/spec-cordova/run.spec.js
+++ b/cordova-lib/spec-cordova/run.spec.js
@@ -21,7 +21,7 @@ var cordova = require('../src/cordova/cordova'),
     superspawn = require('../src/cordova/superspawn'),
     path = require('path'),
     fs = require('fs'),
-    hooker = require('../src/cordova/hooker'),
+    HooksRunner = require('../src/hooks/HooksRunner'),
     Q = require('q'),
     util = require('../src/cordova/util');
 
@@ -36,7 +36,7 @@ describe('run command', function() {
         is_cordova = spyOn(util, 'isCordova').andReturn(project_dir);
         cd_project_root = spyOn(util, 'cdProjectRoot').andReturn(project_dir);
         list_platforms = spyOn(util, 'listPlatforms').andReturn(supported_platforms);
-        fire = spyOn(hooker.prototype, 'fire').andReturn(Q());
+        fire = spyOn(HooksRunner.prototype, 'fire').andReturn(Q());
         prepare_spy = spyOn(cordova.raw, 'prepare').andReturn(Q());
         spyOn(superspawn, 'spawn').andReturn(Q);
     });

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eed41399/cordova-lib/spec-cordova/serve.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/serve.spec.js b/cordova-lib/spec-cordova/serve.spec.js
index 2ea37c2..5c238e3 100644
--- a/cordova-lib/spec-cordova/serve.spec.js
+++ b/cordova-lib/spec-cordova/serve.spec.js
@@ -23,7 +23,6 @@ var cordova = require('../src/cordova/cordova'),
     fs = require('fs'),
     Q = require('q'),
     util = require('../src/cordova/util'),
-    hooker = require('../src/cordova/hooker'),
     tempDir,
     http = require('http'),
     firefoxos_parser = require('../src/cordova/metadata/firefoxos_parser'),


Mime
View raw message