Created
June 22, 2016 14:44
-
-
Save thehig/0ecad92389c7c12caf832b4e8e99b71d to your computer and use it in GitHub Desktop.
coffee: Data driven test
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
# This is a test snippet that will iterate over a collection of expected values, and compare them against the test values | |
describe "option 2", -> | |
it "has 5 observableValues", -> expect(product.required_fields[1].observableValues).to.have.length(5) | |
somoText = (text, i) -> it "[" + i + "] text '" + text + "'", -> expect(product.required_fields[1].observableValues[i]).to.have.property('text', text) | |
somoText(item, i) for item, i in ["Color: Snow", "Color: Sky Blue", "Color: Gray Granite", "Color: Soft Pink", "Color: Light Lemon"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outputs: