Permalink
Browse files

Fixed requirejs timer mock, updated specs count

Resolves #171
  • Loading branch information...
1 parent e57ed02 commit 2e6670f469fd4be026a7567b4fa5df3259020db5 @tebriel tebriel committed Feb 2, 2013
Showing with 8 additions and 12 deletions.
  1. +5 −1 lib/jasmine-node/requirejs-runner.js
  2. +0 −8 spec-requirejs-coffee/require.inline.spec.coffee
  3. +3 −3 specs.sh
View
6 lib/jasmine-node/requirejs-runner.js
@@ -74,7 +74,11 @@ exports.executeJsRunner = function(specCollection, done, jasmineEnv, setupFile)
wrappedScript = template + script;
- vm.runInNewContext(wrappedScript, buildNewContext(s), s.path());
+ var newContext = buildNewContext(s);
+ newContext.setTimeout = jasmine.getGlobal().setTimeout;
+ newContext.setInterval = jasmine.getGlobal().setInterval;
+
+ vm.runInNewContext(wrappedScript, newContext, s.path());
});
specLoader.executeWhenAllSpecsAreComplete(jasmineEnv);
View
8 spec-requirejs-coffee/require.inline.spec.coffee
@@ -1,8 +0,0 @@
-define "formal", ->
- class Formal
- constructor: (@object) ->
- # nada
-
-require ["formal"], (F) ->
- describe "Formal", ->
- expect(F.stuff()).toEqual 5
View
6 specs.sh
@@ -6,22 +6,22 @@ echo "Running all tests located in the spec directory"
command=$entry"spec"
echo $command
time $command #/nested/uber-nested
-echo -e "\033[1;35m--- Should have 50 tests and 84 assertions and 2 Failure. ---\033[0m"
+echo -e "\033[1;35m--- Should have 52 tests and 91 assertions and 2 Failure. ---\033[0m"
echo ""
echo "Running all tests located in the spec directory with coffee option"
command=$entry"--coffee spec"
echo $command
time $command #/nested/uber-nested
-echo -e "\033[1;35m--- Should have 54 tests and 88 assertions and 4 Failures. ---\033[0m"
+echo -e "\033[1;35m--- Should have 56 tests and 95 assertions and 4 Failures. ---\033[0m"
echo ""
echo "Running all tests located in the spec directory with requirejs option"
#command=$entry"--nohelpers --runWithRequireJs spec-requirejs"
command=$entry"--runWithRequireJs spec"
echo $command
time $command
-echo -e "\033[1;35m--- Should have 50 tests and 84 assertions and 1 Failure. ---\033[0m"
+echo -e "\033[1;35m--- Should have 52 tests and 91 assertions and 2 Failure. ---\033[0m"
echo ""
echo "Running all tests located in the spec-requirejs directory with requirejs, requirejs setup, and coffee option"

0 comments on commit 2e6670f

Please sign in to comment.