|
Troubleshooting
Pitfalls and errors that you can avoid
This page lists tips on errors you may encounter while using specs.
"My Thing" should {
"do something" {
...possibly long setup...
something must ... other // matcher
}
}}}}
This would generate:
{{{error: type mismatch;
[WARNING] found : Boolean
[WARNING] required: IntThis is because there is a missing "in" after the example description, so everything inside the accolade is expected to be an Int used to access one character of "do something" (see issue 22 ) |
Sign in to add a comment
I was surprised when an example with no expectations was ignored.
"my example" in { doSomething() // example is ignored! This works, though: doSomething() must be_==(()) }This behavior is indeed the default behavior and is meant at warning you that an example is not specifying any expectations. This can be overriden by changing your specs configuration: http://code.google.com/p/specs/wiki/RunningSpecs#Override_specs_default_behavior
You can also declare any piece of code to be an expectation in itself with:
doSomething.isExpectation