File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -69,18 +69,16 @@ angular.scenario.dsl = angular.scenario.dsl || function(name, fn) {
69
69
*/
70
70
angular . scenario . matcher = angular . scenario . matcher || function ( name , fn ) {
71
71
angular . scenario . matcher [ name ] = function ( expected ) {
72
- var prefix = 'expect ' + this . future . name + ' ' ;
73
- if ( this . inverse ) {
74
- prefix += 'not ' ;
75
- }
72
+ var prefix = 'expect ' + this . future . name + ' ' ,
73
+ not = this . inverse && 'not ' ;
76
74
var self = this ;
77
- this . addFuture ( prefix + name + ' ' + angular . toJson ( expected ) ,
75
+ this . addFuture ( prefix + not + name + ' ' + angular . toJson ( expected ) ,
78
76
function ( done ) {
79
77
var error ;
80
78
self . actual = self . future . value ;
81
79
if ( ( self . inverse && fn . call ( self , expected ) ) ||
82
80
( ! self . inverse && ! fn . call ( self , expected ) ) ) {
83
- error = 'expected ' + angular . toJson ( expected ) +
81
+ error = 'expected ' + not + name + ' ' + angular . toJson ( expected ) +
84
82
' but was ' + angular . toJson ( self . actual ) ;
85
83
}
86
84
done ( error ) ;
You can’t perform that action at this time.
0 commit comments