Skip to content

Instantly share code, notes, and snippets.

@phillipoertel
Created February 23, 2013 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phillipoertel/5020102 to your computer and use it in GitHub Desktop.
Save phillipoertel/5020102 to your computer and use it in GitHub Desktop.
require 'test/unit'
require 'mocha/setup'
require 'fileutils'
class MyClass
def do_it
file = "/tmp/foo"
FileUtils.touch(file)
FileUtils.chmod(0777, file)
end
end
class FooTest < Test::Unit::TestCase
def test_it
FileUtils.expects(:chmod).with(0777, '/tmp/foo')
MyClass.new.do_it
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment