Module: Snapsync::SelfTest

Defined in:
lib/snapsync/test.rb

Overview

This module is the common setup for all tests

It should be included in the toplevel describe blocks

Examples:

require 'snapsync/test'
describe Snapsync do
  include Snapsync::SelfTest
end

Instance Method Summary collapse

Instance Method Details

#make_tmpdirObject



55
56
57
# File 'lib/snapsync/test.rb', line 55

def make_tmpdir
    @tempdirs << Dir.mktmpdir
end

#setupObject



41
42
43
44
45
# File 'lib/snapsync/test.rb', line 41

def setup
    @tempdirs = Array.new
    super
    # Setup code for all the tests
end

#teardownObject



47
48
49
50
51
52
53
# File 'lib/snapsync/test.rb', line 47

def teardown
    @tempdirs.each do |dir|
        FileUtils.rm_rf dir
    end
    super
    # Teardown code for all the tests
end