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
0085284f
...
0085284fd7fb943c7673aa6a8b155a6d064b3668
authored
2012-05-09 11:58:23 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'juliangruber/master'
2 parents
06fca0a4
47eff271
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
modules/tester.js
modules/tester.js
View file @
0085284
...
...
@@ -141,6 +141,41 @@ var Tester = function Tester(casper, options) {
}
});
};
/**
* Asserts that two values are strictly not equals.
*
* @param Mixed subject The value to test
* @param Mixed expected The unwanted value
* @param String message Test description
*/
this
.
assertNotEquals
=
function
assertNotEquals
(
subject
,
shouldnt
,
message
)
{
var
eventName
;
message
=
message
||
""
;
if
(
!
this
.
testEquals
(
subject
,
shouldnt
))
{
eventName
=
"success"
;
casper
.
echo
(
this
.
colorize
(
this
.
options
.
passText
,
'INFO'
)
+
' '
+
this
.
formatMessage
(
message
));
this
.
testResults
.
passed
++
;
}
else
{
eventName
=
"fail"
;
casper
.
echo
(
this
.
colorize
(
this
.
options
.
failText
,
'RED_BAR'
)
+
' '
+
this
.
formatMessage
(
message
,
'WARNING'
));
this
.
comment
(
' got: '
+
utils
.
serialize
(
subject
));
this
.
comment
(
' shouldnt: '
+
utils
.
serialize
(
shouldnt
));
this
.
testResults
.
failed
++
;
}
this
.
emit
(
eventName
,
{
type
:
"assertNotEquals"
,
message
:
message
,
details
:
f
(
"test failed; shouldnt: %s; got: %s"
,
shouldnt
,
subject
),
file
:
this
.
currentTestFile
,
values
:
{
subject
:
subject
,
shouldnt
:
shouldnt
}
});
};
/**
* Asserts that a code evaluation in remote DOM resolves to true.
...
...
Please
register
or
sign in
to post a comment