Created
December 18, 2014 12:35
-
-
Save mdix/12e6aa27f80ba6c010af to your computer and use it in GitHub Desktop.
jasmine data provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['lib/validator/rule.notEmpty'], function(_ruleNotEmpty_) { | |
describe('rule.notEmpty', function() { | |
var ruleNotEmpty; | |
beforeEach(function() { | |
ruleNotEmpty = new _ruleNotEmpty_(); | |
}); | |
describe('its checkField function', function() { | |
// just wrap an it in a loop (if you have jquery you can use each) | |
$.each(['blah', ' blubb', ' blah ', ' 123\t'], function(index, value) { | |
it('should return true with other non empty strings (cur: ' + value + ')', function(done) { | |
expect(ruleNotEmpty.checkField(value)).toBe(true); | |
done(); | |
}); | |
}); | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment