In a nutshell, it allows you to create plain-text, executable stories such as:
Story: Daily hour calculationThe results of running this story looks like this:
As a user
I want to be able to enter my time in and time out into my time sheet
So that I can track my hours
Scenario: calculate whole hours
Given a time in of 2007-07-09 19:00
And a time out of 2007-07-09 21:00
Then the hours should be 2
Scenario: 0 minutes is 0 hours
Given a time in of 2007-07-09 19:00
And a time out of 2007-07-09 19:00
Then the hours should be 0
denethor:stories $ruby day.rbA really neat thing is that the output can be saved to a file and executed.
Running 2 scenarios:
Story: Daily hour calculation
As a user
I want to be able to enter my time in and time out into my time sheet
So that I can track my hours
Scenario: calculate whole hours
Given a time in of 2007-07-09 19:00
And a time out of 2007-07-09 21:00
Then the hours should be 2
.
Scenario: 0 minutes is 0 hours
Given a time in of 2007-07-09 19:00
And a time out of 2007-07-09 19:00
Then the hours should be 0
.
2 scenarios: 2 succeeded, 0 failed, 0 pending
David and Dave presented some really neat ideas around the story runner. One particularly interesting one was the potential of e-mailing to a remote story runner and getting the results e-mailed back. Lots of interesting possibilities lie here.
To get more details, check out David Chelimsky's blog.
Note that at some point the RubyConf talks will be made available online, although I am not sure when and where.
I recommend pulling the latest code from trunk (svn checkout http://rspec.rubyforge.org/svn/) and giving it a spin.
No comments:
Post a Comment