Created
December 11, 2012 01:13
-
-
Save tatsuro-ueda/4254898 to your computer and use it in GitHub Desktop.
Jasmine beforeEach / afterEach in CoffeeScript
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
# 「JS開発におけるTDDと自動テストツール利用の勘所 」より引用。 | |
# http://www.slideshare.net/KojiNakamura/jstdd | |
describe "Object", -> | |
beforeEach -> | |
object = new MyObject | |
afterEach -> | |
# do something... | |
describe "#methodA", -> | |
it "should be ok", -> | |
expect(object.methodA()).toBeTruthy() | |
describe "#methodB", -> | |
it "should be ok", -> | |
expect(object.methodB).toBeTruthy() | |
describe "(context)", -> | |
beforeEach -> | |
object.someMethod() | |
describe "#methodC", -> | |
it "should be ok", -> | |
expect(object.methodC).toBeTruthy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment