Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
4e3a6af1
...
4e3a6af173fa86775684350fdfe5095bbc052376
authored
2013-08-30 01:07:49 +0200
by
Mickaël Andrieu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Refactoring of method and correct the output
1 parent
3f97d3d1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
modules/tester.js
modules/tester.js
View file @
4e3a6af
...
...
@@ -849,13 +849,15 @@ Tester.prototype.assertType = function assertType(subject, type, message) {
*/
Tester
.
prototype
.
assertInstanceOf
=
function
assertInstanceOf
(
subject
,
constructor
,
message
)
{
"use strict"
;
var
actual
=
subject
instanceof
constructor
;
return
this
.
assert
(
utils
.
equals
(
actual
,
true
),
message
,
{
if
(
utils
.
betterTypeOf
(
constructor
)
!==
"function"
)
{
throw
new
CasperError
(
'Invalid constructor.'
);
}
return
this
.
assert
(
subject
instanceof
constructor
,
message
,
{
type
:
"assertInstanceOf"
,
standard
:
f
(
'Subject is an instance of: "%s"'
,
constructor
),
standard
:
f
(
'Subject is an instance of: "%s"'
,
constructor
.
name
),
values
:
{
subject
:
subject
,
constructor
:
constructor
,
constructor
:
constructor
.
name
,
actual
:
actual
}
});
...
...
Please
register
or
sign in
to post a comment