Hello,
I'm working on a Rails app. I want to test with rspec my method "start!" of my model Backup.
So here the specs (all are methods, too):
Backupshould copy files to folder /backupsBackupshould check md5 sumBackupshould delete original files
For my tests, I create fake files, based on fixtures :
MyFile.all.each{|r| system("touch #{r.path}") }
Then, @backup.start! should delete some of this files (not all).
The problem is : I don't want to re-run all the opérations for each test ! I could write one big test, with all the requirements include in it, but it would be ugly...
The before(:all) pattern, event in contexts runs before all contexts, and fixtures are not available, for design reasons.
Any suggestions ?
Thanks.