Sha256: d5fa6c2cbca8c52b5dcd435b6c15abcf4d832fca9f49e3c12701d83351fbbd0e

Contents?: true

Size: 365 Bytes

Versions: 15

Compression:

Stored size: 365 Bytes

Contents

module VMC::TestSupport::FakeHomeDir
  def self.included(klass)
    def klass.use_fake_home_dir(&block)
      around do |example|
        dir = instance_exec(&block)
        original_home_dir = ENV['HOME']
        ENV['HOME'] = dir
        begin
          example.call
        ensure
          ENV['HOME'] = original_home_dir
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
af-0.5.0.beta.11 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.10 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.9 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.8 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.7 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.6 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.5 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.4 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.3 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.2 lib/vmc/test_support/fake_home_dir.rb
af-0.5.0.beta.1 lib/vmc/test_support/fake_home_dir.rb
vmc-0.5.0.rc1 lib/vmc/test_support/fake_home_dir.rb
vmc-0.5.0.beta.12 lib/vmc/test_support/fake_home_dir.rb
vmc-0.5.0.beta.11 lib/vmc/test_support/fake_home_dir.rb
vmc-0.5.0.beta.10 lib/vmc/test_support/fake_home_dir.rb