diff --git a/source/test/mocking/matchers.js b/source/test/mocking/matchers.js index 238bf2b9..7ab375af 100644 --- a/source/test/mocking/matchers.js +++ b/source/test/mocking/matchers.js @@ -1,12 +1,12 @@ Test.Mocking.extend({ Anything: new JS.Class({ equals: function() { return true }, - toString: function() { return 'anything' } + toString: function() { return 'anything()' } }), AnyArgs: new JS.Class({ equals: function() { return Enumerable.ALL_EQUAL }, - toString: function() { return '*arguments' } + toString: function() { return 'anyArgs()' } }), ArrayIncluding: new JS.Class({ @@ -64,9 +64,8 @@ Test.Mocking.extend({ }, toString: function() { - var name = Console.convert(this._type), - an = /^[aeiou]/i.test(name) ? 'an' : 'a'; - return an + '(' + name + ')'; + var name = Console.convert(this._type); + return 'instanceOf(' + name + ')'; } }), @@ -81,7 +80,7 @@ Test.Mocking.extend({ toString: function() { var name = Console.convert(this._type); - return 'matching(' + name + ')'; + return 'match(' + name + ')'; } }) }); diff --git a/test/specs/test/mocking_spec.js b/test/specs/test/mocking_spec.js index fb8d4f47..4e12c61b 100644 --- a/test/specs/test/mocking_spec.js +++ b/test/specs/test/mocking_spec.js @@ -284,7 +284,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectMethod(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments )" ) + "getName( anyArgs() )" ) })}) }}) @@ -315,7 +315,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectMethod(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments )\n" + + "getName( anyArgs() )\n" + "at least 3 times\n" + "but 2 calls were made" ) })}) @@ -332,7 +332,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectMethod(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments )" ) + "getName( anyArgs() )" ) })}) }}) }}) @@ -366,7 +366,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectMethod(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments )\n" + + "getName( anyArgs() )\n" + "at most 3 times\n" + "but 4 calls were made" ) })}) @@ -418,7 +418,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectMethod(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments )\n" + + "getName( anyArgs() )\n" + "exactly 0 times\n" + "but 1 call was made" ) })}) @@ -438,7 +438,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectMethod(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments )\n" + + "getName( anyArgs() )\n" + "exactly 2 times\n" + "but 3 calls were made" ) })}) @@ -456,7 +456,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectMethod(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments )\n" + + "getName( anyArgs() )\n" + "exactly 2 times\n" + "but 1 call was made" ) })}) @@ -620,7 +620,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectWithYields(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( *arguments, a(Function) )" ) + "getName( anyArgs(), instanceOf(Function) )" ) })}) }}) @@ -654,7 +654,7 @@ Test.MockingSpec = JS.Test.describe(JS.Test.Mocking, function() { with(this) { "testExpectWithYields(TestedSuite):\n" + "Mock expectation not met\n" + "<[OBJECT]> expected to receive call\n" + - "getName( 5, 6, a(Function) )" ) + "getName( 5, 6, instanceOf(Function) )" ) })}) }}) }})