Skip to content

Instantly share code, notes, and snippets.

@robinboehm
Created February 13, 2014 11:49
Show Gist options
  • Save robinboehm/8973753 to your computer and use it in GitHub Desktop.
Save robinboehm/8973753 to your computer and use it in GitHub Desktop.
task strings
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="bower_components/jasmine/lib/jasmine-core/jasmine.css">
<link rel="stylesheet" type="text/css" href="css/jasmine.css">
</head>
<body>
<script src="bower_components/jasmine/lib/jasmine-core/jasmine.js"></script>
<script src="bower_components/jasmine/lib/jasmine-core/jasmine-html.js"></script>
<script src="bower_components/jasmine/lib/jasmine-core/boot.js"></script>
<!-- App -->
<script src="strings.js"></script>
<!-- Spec -->
<script src="strings.spec.js"></script>
</body>
</html>
var testString = 'Hello JavaScript';
describe("The variable simpleSubString", function () {
it("should be defined", function () {
expect(simpleSubString).toBeDefined();
});
it("should be a string", function () {
expect(typeof simpleSubString).toBe('string');
});
it("should equal the 'Java' (use String.substring) ", function () {
expect(simpleSubString).toEqual('Java');
});
/*it("should use String.substring to produce the word", function () {
expect(String.prototype.substring).toHaveBeenCalled();
});*/
});
describe("The variable simpleSubStr", function () {
it("should be defined", function () {
expect(simpleSubStr).toBeDefined();
});
it("should be a string", function () {
expect(typeof simpleSubStr).toBe('string');
});
it("should equal the 'JavaScript' (use String.substr) ", function () {
expect(simpleSubStr).toEqual('JavaScript');
});
/*it("should use String.substring to produce the word", function () {
expect(String.prototype.substring).toHaveBeenCalled();
});*/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment