Created
April 3, 2009 02:59
-
-
Save kristopher/89616 to your computer and use it in GitHub Desktop.
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
<script type="text/javascript"> | |
jShoulda.useStyle('describe'); | |
describe('jRspec', {}, | |
describe('"should"', {}, | |
it('should be defined should on object', function() { | |
var obj = {}; | |
obj.should.should(this).equal(jRspec.should); | |
}), | |
it('should pass if with a simple equals case', function() { | |
'1'.should(this).equal('1') | |
}), | |
it('should pass with a simple be case', function() { | |
var obj = {} | |
obj.should(this).equal(obj) | |
}), | |
it('should pass with a simple not equals case', function() { | |
'2'.should(this).not_equal('1') | |
}))(), | |
describe('stub', { | |
setup: function() { | |
var obj = { test: 'test' } | |
} | |
}, | |
it("should stub a function", function() { | |
var obj = { test: 'test' } | |
obj.stub('test') | |
'test'.should(this).not_equal(obj.test) | |
Moksi.revert() | |
}), | |
it("and_return should set the return value", function() { | |
var obj = { test: 'test' } | |
obj.stub('test').and_return('stubbed') | |
obj.test.should(this).equal('stubbed') | |
Moksi.revert() | |
}))())(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment