Sha256: 50d4833a930ec8df4a9f587e9b1c12d5a53265c5c3aa2e88daae44d9c3922349

Contents?: true

Size: 784 Bytes

Versions: 19

Compression:

Stored size: 784 Bytes

Contents

require "fileutils"
require "pathname"

require "log4r"

require "support/isolated_environment"

module Unit
  class IsolatedEnvironment < ::IsolatedEnvironment
    def create_vagrant_env(options=nil)
      options = {
        :cwd => @workdir,
        :home_path => @homedir
      }.merge(options || {})

      Vagrant::Environment.new(options)
    end

    def vagrantfile(contents, root=nil)
      root ||= @workdir
      root.join("Vagrantfile").open("w+") do |f|
        f.write(contents)
      end
    end

    def box(name, vagrantfile_contents="")
      box_dir = boxes_dir.join(name)
      box_dir.mkpath
      vagrantfile(vagrantfile_contents, box_dir)
      box_dir
    end

    def boxes_dir
      dir = @homedir.join("boxes")
      dir.mkpath
      dir
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
vagrantup-1.0.0 test/unit/support/isolated_environment.rb
vagrantup-0.9.99.2 test/unit/support/isolated_environment.rb
vagrantup-0.9.99.1 test/unit/support/isolated_environment.rb
vagrantup-0.9.7 test/unit/support/isolated_environment.rb
vagrantup-0.9.6 test/unit/support/isolated_environment.rb
vagrantup-0.9.5 test/unit/support/isolated_environment.rb
vagrantup-0.9.4 test/unit/support/isolated_environment.rb
vagrantup-0.9.3 test/unit/support/isolated_environment.rb
vagrantup-0.9.2 test/unit/support/isolated_environment.rb
vagrantup-0.9.1 test/unit/support/isolated_environment.rb
vagrantup-0.9.0 test/unit/support/isolated_environment.rb
vagrant-1.0.0 test/unit/support/isolated_environment.rb
vagrant-0.9.7 test/unit/support/isolated_environment.rb
vagrant-0.9.5 test/unit/support/isolated_environment.rb
vagrant-0.9.4 test/unit/support/isolated_environment.rb
vagrant-0.9.3 test/unit/support/isolated_environment.rb
vagrant-0.9.2 test/unit/support/isolated_environment.rb
vagrant-0.9.1 test/unit/support/isolated_environment.rb
vagrant-0.9.0 test/unit/support/isolated_environment.rb