xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js"></script>
</head>
<body>
<script id="jsbin-javascript">
describe(" testing spies",function(){
var foo;
var name;
beforeEach(function(){
foo={
setName:function(){
name="Mahesh";
}
};
spyOn(foo,'setName');
})
it("should not have been called",function(){
foo.setName();
expect(name).toBeUndefined();
expect(foo.setName).toHaveBeenCalled()
expect(foo.setName).toHaveBeenCalledWith()
})
})
</script>
<script id="jsbin-source-html" type="text/html">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-3.1.0.js"><\/script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js"><\/script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js"><\/script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js"><\/script>
</head>
<body>
</body>
</html></script>
<script id="jsbin-source-javascript" type="text/javascript">describe(" testing spies",function(){
var foo;
var name;
beforeEach(function(){
foo={
setName:function(){
name="Mahesh";
}
};
spyOn(foo,'setName');
})
it("should not have been called",function(){
foo.setName();
expect(name).toBeUndefined();
expect(foo.setName).toHaveBeenCalled()
expect(foo.setName).toHaveBeenCalledWith()
})
})</script></body>
</html>
Modified http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js to a secure url
Modified http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js to a secure url
Modified http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js to a secure url
https://code.jquery.com/jquery-3.1.0.js
https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js
https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js
https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js
https://code.jquery.com/jquery-3.1.0.js
https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js
https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js
https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js