On Fri, 24 Sep 2010 11:09:09 -0700, Matt Robinson wrote: > > Great to see some unit tests getting converted to specs. I noticed > with the spec though that it won't run standalone, that is not part of > a full rspec suite run. If you add a > > require 'tempfile' >
There are a number of spec files that fail to run standalone. I'll try to put together a patch to fix them, in addition to this one. > to the beginning it will run on its own. I also noticed that instead > of creating the tempfile to get the tempdir you could do > > require 'tmpdir' > Dir.mktmpdir > > However, I was looking for a way to make a tmpdir yesterday also and > found we have some helper functions in spec/lib/puppet_spec/files.rb. > These seem nice in that they cleanup after themselves after each test > without an after block by adding the tempfile or tempdir to a global > variable that gets removed in an after block in spec_helper. The > global variable makes me cringe at first, but it seems like a > reasonable thing to do in a test suite where you want to cleanup your > temp stuff. > Matt > I forget exactly which spec file I got my example from for creating the tempdir, but it might be worth it, at some point, to go through, and standardize the things like this. Do you think this instance should be fixed before this patch goes in, or would you be comfortable with it being part of a more general clean-up? -- Jacob Helwig
signature.asc
Description: Digital signature