Skip to content

Instantly share code, notes, and snippets.

@MichaelXavier
Created June 18, 2010 07:32
Show Gist options
  • Save MichaelXavier/443367 to your computer and use it in GitHub Desktop.
Save MichaelXavier/443367 to your computer and use it in GitHub Desktop.
class MyDir < Dir
class << self
def [](args)
super(args).collect {|entry| do_junk(entry)}
end
end
end
describe MyDir
before do
Dir.stub(:[]).and_return(%w(file1 file2))
end
it do
MyDir['*'].should # undefine method [] for MyDir
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment