[TxMt] RSpec snippet beginnings

jeanpierre at gmail.com jeanpierre at gmail.com
Fri Nov 17 21:55:44 UTC 2006


recently i was giving RSpec[1] and Behaviour-Driven Development
(hereforth BDD)[2] a look and found myself repeatedly writing the same
code constructs. i quickly slapped together two snippets for the ruby
bundle that seem to help out. the snippets could be made more spiffy
perhaps by turning them into macros and make them act similar to the
rails migration macros - but they still might be of some use in their
initial form.

worth noting, if you install RSpec 0.7.* and follow along with the BDD
tutorial[3], make sure change all of their:
   object.should_be_equal
to:
   object.should_be ==
or else you will be checking for object equality rather than value
equality (as mentioned in their upgrade notice[4]). i sure wish they
would have updated their tutorial...

cheers,
jean-pierre



[1]  RSpec  <http://rspec.rubyforge.org/>
[2]  BDD  <http://behaviour-driven.org/>
[3]  RSpec tutorial  <http://rspec.rubyforge.org/tutorials/>
[4]  RSpec update notice  <http://rspec.rubyforge.org/upgrade.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: context.tmSnippet
Type: application/octet-stream
Size: 517 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20061117/b05de99d/attachment.tmSnippet>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: specify.tmSnippet
Type: application/octet-stream
Size: 492 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20061117/b05de99d/attachment-0001.tmSnippet>


More information about the textmate mailing list