initial commit
This commit is contained in:
commit
d3fcd7f10c
3159 files changed
+349702
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
/*!
|
||||
* Should
|
||||
* Copyright(c) 2010-2014 TJ Holowaychuk <tj@vision-media.ca>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
module.exports = function(should, Assertion) {
|
||||
Assertion.add('startWith', function(str, description) {
|
||||
this.params = { operator: 'to start with ' + should.format(str), message: description };
|
||||
|
||||
this.assert(0 === this.obj.indexOf(str));
|
||||
});
|
||||
|
||||
Assertion.add('endWith', function(str, description) {
|
||||
this.params = { operator: 'to end with ' + should.format(str), message: description };
|
||||
|
||||
this.assert(this.obj.indexOf(str, this.obj.length - str.length) >= 0);
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user