The blog of freelance Designer & Developer, David Rice.
Recently I’ve been thinking about updating some test cases to the excellent RSpec, I really didn’t want to have to manually create all the spec files so I put it off… until today when I finally got some inspiration by way of the Pivotal Labs Blog. With a bit of work I was able to put together this plugin, to the point where it would generate specs that would pass, woo! That was with a small-ish application, with any significant sized I have tried it out on it’s taken a while to massage the generated specs so they will run. So if you’ve been putting off the move to RSpec you need wait no longer! :)
script/plugin install \
http://svn.davidjrice.co.uk/svn/projects/plugins/test_unit_to_rspec_converter
rake convert_to_rspec
Before you run the command, take heed as it will overwrite files in the spec directory of your application if they already exist!
Update If this is your first time using rspec then do the following too.
sudo gem install rspec
script/plugin install \
svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_5/rspec_on_rails
script/generate rspec
rake spec
If you do try it out let me know how this goes for you, with your help we can make the conversion process better! Comments and suggestions welcome.
- email me@davidjrice.co.uk
- phone me on +44 7590 538 303
If you need help with the Design, Build, Management, Hosting or Support of your project do get in touch, I'd love to hear from you!
Recently
- 22 Apr » HTML5 Validator.nu ruby gem
- 28 Sep » ActiveMerchant Support for Realex
- 09 Sep » Getting Real with Realex
- 04 Sep » Back in Black
- 25 Nov » Rails Session Storage Cookie Vs Active Record
- 06 Jun » Get Exceptional
- 21 Apr » git and github ftw
- 19 Apr » Co-Working Belfast, Put Your Money Where Your Mouth Is
- 28 Mar » Co-working Belfast Plan
- 26 Feb » Do Not Buy an Apple AirPort Extreme Base Station, They Crash and Burn
- 13 Feb » Ssh, Presentation in Progress