Last active
August 29, 2015 14:25
-
-
Save efleming969/85c40b6878aba06c9b59 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
it ( 'should calculate the proper value', function () { | |
var ds = new DataService(); | |
var x = new Foo( ds ); | |
sinon.stub( ds, "lookupMultiplier" ).returns( 2 ); | |
var rst = x.calculateValueBasedOnLookup( 5 ); | |
expect( rst ).to.equal( 10 ); | |
} ); | |
it ( 'should send an email', function () { | |
var es = new EmailService(); | |
var bar = new Bar( es ); | |
var expectation = sinon.mock( es ) | |
.expects( "send" ).withArgs( "hello" ); | |
bar.somethingThatSendsAnEmail(); | |
expectation.verify(); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment