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