17 Oct, 2008, Chris Bailey wrote in the 1st comment:
Votes: 0
So, I've been playing around with rspec a lot and trying to get the hang of BDD and proper testing procedures. I spent all day today developing intuitive and useful tests for my latest project. After staring at the ugly console output from the tests for several hours I discovered that RSpec can output to beautiful html pages filled with syntax highlighting and colors! I decided to throw together a quick script to generate the HTML output for all of my tests! It didn't work as planned, see if you can tell why.

Dir.foreach(Dir.pwd) do |file|
if file.include?("_spec.rb")
system("spec -f h:#{file} #{file}")
puts("Generated HTML rspec for #{file}")
end
end


The idea was to take a bunch of files named *_spec.rb and run tests on them. Then output the result of the test to *_spec.html …. Unfortunately, I got too excited and didn't pay attention to what I was doing and ended up overwriting ALL of my test patterns with pretty colorful html.. =)
17 Oct, 2008, Vassi wrote in the 2nd comment:
Votes: 0
oops =\

Reminds me of the time I was trying to convert a bunch of WMAs to MP3s and then I made a little app to compare the two directory trees and delete any WMAs for which there were MP3s. The first run through I was going to just generate a text list so I could verify that it was picking the right ones.

I forgot to uncomment the actual deleting part, lost 4 gigs of music =\
17 Oct, 2008, Chris Bailey wrote in the 3rd comment:
Votes: 0
Oof, that's harsh! I really hate it when I do stupid things like that. I guess if I had properly tested my test code generator for tests it wouldn't have messed up :P
17 Oct, 2008, The_Fury wrote in the 4th comment:
Votes: 0
Hey i do things like this all the time. Life would not be as fun without these sorts of Kodak moments.
17 Oct, 2008, Chris Bailey wrote in the 5th comment:
Votes: 0
It turned out better than I hoped. I'm re-writing my all of my tests now with a much better understanding of the system and they are turning out better than before. =)
17 Oct, 2008, tphegley wrote in the 6th comment:
Votes: 0
I've typed rm instead of vi before.
17 Oct, 2008, Chris Bailey wrote in the 7th comment:
Votes: 0
Ouch, I haven't done that yet! =)
17 Oct, 2008, Caius wrote in the 8th comment:
Votes: 0
I once typed rm -rf * in the wrong directory. My user's home directory, of course.
17 Oct, 2008, quixadhal wrote in the 9th comment:
Votes: 0
It's more fun when you have root privs and are in /usr :evil:

The most fun, of course, was when someone removed /lib/libc.so on one of the machines on campus. It's rather neat to see what commands you can still use with no shared libraries.

BTW - that brings up a gripe of mine. You've probably seen the /sbin and /usr/sbin directories. Like the linux distributions these days, I used to mistakenly think those meant "system binaries". No, it's supposed to be for "static binaries"… things that will still work to save your bacon when upgrading libc fails. Go look, use ldd on things in /sbin, they're not static these days. :(
17 Oct, 2008, elanthis wrote in the 10th comment:
Votes: 0
quixadhal said:
BTW - that brings up a gripe of mine. You've probably seen the /sbin and /usr/sbin directories. Like the linux distributions these days, I used to mistakenly think those meant "system binaries". No, it's supposed to be for "static binaries"… things that will still work to save your bacon when upgrading libc fails. Go look, use ldd on things in /sbin, they're not static these days. :(


Modern Linux systems don't use the file system right in any way. Heck, Fedora just added /sbin and /usr/sbin to every users' $PATH. And Linux distros for years have just been dumping every single user binary into /usr/bin instead of breaking up related binaries into sub-directories in /usr like was intended. Even /usr/X11R6 has disappeared. Now /usr/bin has thousands and thousands of entries on a typical Linux machine, which is kind of a major pain for tab completion and most GUI file managers, and makes binary name conflicts even more common and difficult to avoid.

Linux is a nice system, but it is in no way a model of perfection. Especially not these days where most of the "rockstar" Linux developers have no real history or knowledge with UNIX, and they're pretty much just making decisions that they think are good without understanding that those same issues were thought about – and solved properly – 20+ years ago.
0.0/10