cfSpec v0.1.1 has just been posted to RIAForge and features numerous improvements, including a completely rewritten core that’s over 10 times faster.

Improved SpecRunner

In addition to the extreme speed-up, the SpecRunner now uses color coordinated headers to give a quick visual summary of example groups. Green = all passed. Yellow = some pending. Red = some failed. The main summary header at the top also includes a total example count with number of examples that failed or are pending.

Official Support for Spec Suites

There is now a tag for running all specs with-in a given folder (see /cfspec/spec/index.cfm). Although this was already possible, it was very buggy and caused memory errors. The new <suite> tag is efficient and provides summary details in the heading, just like individual specs.

Updated Matchers

The following Be matchers were added:
  • $("foo").shouldBeSimpleValue()
  • $(42).shouldBeNumeric()
  • $("2009-1-10").shouldBeDate()
  • $(true).shouldBeBoolean()
  • $(stub()).shouldBeObject()
  • $(structNew()).shouldBeStruct()
  • $(arrayNew(1)).shouldBeArray()
  • $(queryNew("foo")).shouldBeQuery()
The Contain matcher got an upgrade to allow such concoctions as:
  • $("multiple substrings").shouldContain("mult", "subs")
  • $(array).shouldContain(element)
  • $(struct).shouldContain(key)
  • $(struct).shouldContain(substruct)
  • $(query).shouldContain(columnName)
  • $(query).shouldContain(structOfColumnsAndValues)
  • $(object).shouldContain(element) (calls object.hasElement(element))
The Throw matcher can now be restricted based on exception type, message, or detail:
  • $(object).nonExistantMethod().shouldThrow("Any", "method nonExistantMethod was not found")
  • $(object).dangerousMethod().shouldThrow("ExceptionTypeOrAny", "regex for message", "regex for detail")
The Have matcher can deal with singulars of a named collection:
  • $(parent).shouldHave(1).child() (calls parent.getChildren())

Improved Error Handling

Finally, the error-handling has been improved to report on incompatible data-types, etc. rather than blowing up, and a few obscure bugs were found and stamped out.

Thanks for all the support and feedback. I will continue to keep you updated as new versions roll out.

8 Responses to “What's New in cfSpec v0.1.1?”

  • i’m diggin’ the throw matcher Ron! It’s cool watching all this evolve

  • Very nice work, Ron! This is now on the big ToDo list …

    bill

  • Can’t wait to use it on my next project. :)

  • Why are there 19 failures in cfspec v0.1.1? Shouldn’t they all pass?

  • how to make an returns “pending” state?

  • Henry, the reason that there are 19 failures is that cfSpec is incomplete. I wanted to use it to test itself, but there are certain limitations until it is complete. As of v0.1.1 there’s no easy way to set expectations on html results, so I decided to compromise by making some tests that are supposed to fail. Once that functionality is available, I plan to re-write the failing tests to use it so that you get 100% green.

    The pending state represents a test with no expectations (in v0.2.0 which is coming soon), or a test in which you call pend(message).

  • Hi Ron, when can we expect to see the next version of cfspec?

    I started using cfspec on my new project and loved it.

    btw, are you aware of the issue I filed here? http://cfspec.riaforge.org/index.cfm?event=page.issue&issueid=23EC319C-0E03-114E-F3B512B39C9DD46A

    Thanks, looking forward to the next release.

  • Henry,

    Thanks so much! I’m glad to see people already using cfSpec. I have seen your bug report, and will be incorporating that into the next release.

    I do not have a set release schedule as of yet, but am zeroing in on a v0.2 release. I’ve slowed down a bit in response to lots of paying work (good problem). I recommend watching this site, or the project wiki, which I will update with my feature release plan once that is ironed out.

Sorry, comments are closed for this article.