Cleaning up explicit dependencies

This commit is contained in:
Davis W. Frank and Sheel Choksi
2013-07-01 15:55:43 -07:00
parent 661a884416
commit 2916a8a1ff
8 changed files with 20 additions and 16 deletions

View File

@@ -52,12 +52,12 @@ getJasmineRequireObj().core = function(jRequire) {
j$.Suite = jRequire.Suite(); j$.Suite = jRequire.Suite();
j$.version = jRequire.version(); j$.version = jRequire.version();
j$.matchers = jRequire.requireMatchers(jRequire); j$.matchers = jRequire.requireMatchers(jRequire, j$);
return j$; return j$;
}; };
getJasmineRequireObj().requireMatchers = function(jRequire) { getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
var availableMatchers = [ var availableMatchers = [
"toBe", "toBe",
"toBeCloseTo", "toBeCloseTo",
@@ -81,7 +81,7 @@ getJasmineRequireObj().requireMatchers = function(jRequire) {
for (var i = 0; i < availableMatchers.length; i++) { for (var i = 0; i < availableMatchers.length; i++) {
var name = availableMatchers[i]; var name = availableMatchers[i];
matchers[name] = jRequire[name](); matchers[name] = jRequire[name](j$);
} }
return matchers; return matchers;
@@ -736,6 +736,10 @@ getJasmineRequireObj().Any = function() {
return typeof other == 'object'; return typeof other == 'object';
} }
if (this.expectedObject == Boolean) {
return typeof other == 'boolean';
}
return other instanceof this.expectedObject; return other instanceof this.expectedObject;
}; };
@@ -1827,7 +1831,7 @@ getJasmineRequireObj().toBeLessThan = function() {
return toBeLessThan; return toBeLessThan;
}; };
getJasmineRequireObj().toBeNaN = function() { getJasmineRequireObj().toBeNaN = function(j$) {
function toBeNaN() { function toBeNaN() {
return { return {
@@ -1933,7 +1937,7 @@ getJasmineRequireObj().toEqual = function() {
return toEqual; return toEqual;
}; };
getJasmineRequireObj().toHaveBeenCalled = function() { getJasmineRequireObj().toHaveBeenCalled = function(j$) {
function toHaveBeenCalled() { function toHaveBeenCalled() {
return { return {
@@ -1962,7 +1966,7 @@ getJasmineRequireObj().toHaveBeenCalled = function() {
return toHaveBeenCalled; return toHaveBeenCalled;
}; };
getJasmineRequireObj().toHaveBeenCalledWith = function() { getJasmineRequireObj().toHaveBeenCalledWith = function(j$) {
function toHaveBeenCalledWith(util) { function toHaveBeenCalledWith(util) {
return { return {
@@ -2008,7 +2012,7 @@ getJasmineRequireObj().toMatch = function() {
return toMatch; return toMatch;
}; };
getJasmineRequireObj().toThrow = function() { getJasmineRequireObj().toThrow = function(j$) {
function toThrow(util) { function toThrow(util) {
return { return {
@@ -2055,7 +2059,7 @@ getJasmineRequireObj().toThrow = function() {
return toThrow; return toThrow;
}; };
getJasmineRequireObj().toThrowError = function() { getJasmineRequireObj().toThrowError = function(j$) {
function toThrowError (util) { function toThrowError (util) {
return { return {
compare: function(actual) { compare: function(actual) {

View File

@@ -1,4 +1,4 @@
getJasmineRequireObj().requireMatchers = function(jRequire) { getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
var availableMatchers = [ var availableMatchers = [
"toBe", "toBe",
"toBeCloseTo", "toBeCloseTo",
@@ -22,7 +22,7 @@ getJasmineRequireObj().requireMatchers = function(jRequire) {
for (var i = 0; i < availableMatchers.length; i++) { for (var i = 0; i < availableMatchers.length; i++) {
var name = availableMatchers[i]; var name = availableMatchers[i];
matchers[name] = jRequire[name](); matchers[name] = jRequire[name](j$);
} }
return matchers; return matchers;

View File

@@ -1,4 +1,4 @@
getJasmineRequireObj().toBeNaN = function() { getJasmineRequireObj().toBeNaN = function(j$) {
function toBeNaN() { function toBeNaN() {
return { return {

View File

@@ -1,4 +1,4 @@
getJasmineRequireObj().toHaveBeenCalled = function() { getJasmineRequireObj().toHaveBeenCalled = function(j$) {
function toHaveBeenCalled() { function toHaveBeenCalled() {
return { return {

View File

@@ -1,4 +1,4 @@
getJasmineRequireObj().toHaveBeenCalledWith = function() { getJasmineRequireObj().toHaveBeenCalledWith = function(j$) {
function toHaveBeenCalledWith(util) { function toHaveBeenCalledWith(util) {
return { return {

View File

@@ -1,4 +1,4 @@
getJasmineRequireObj().toThrow = function() { getJasmineRequireObj().toThrow = function(j$) {
function toThrow(util) { function toThrow(util) {
return { return {

View File

@@ -1,4 +1,4 @@
getJasmineRequireObj().toThrowError = function() { getJasmineRequireObj().toThrowError = function(j$) {
function toThrowError (util) { function toThrowError (util) {
return { return {
compare: function(actual) { compare: function(actual) {

View File

@@ -30,7 +30,7 @@ getJasmineRequireObj().core = function(jRequire) {
j$.Suite = jRequire.Suite(); j$.Suite = jRequire.Suite();
j$.version = jRequire.version(); j$.version = jRequire.version();
j$.matchers = jRequire.requireMatchers(jRequire); j$.matchers = jRequire.requireMatchers(jRequire, j$);
return j$; return j$;
}; };