Sha256: 4fae0b202bd7c7dfb4c08897ca9196d46f19570211eddc2e6d09aed25f2311c9

Contents?: true

Size: 1.08 KB

Versions: 96

Compression:

Stored size: 1.08 KB

Contents

require "fileutils"
require "pathname"
require "tmpdir"

require "vagrant-spec/acceptance/isolated_environment"

describe Vagrant::Spec::AcceptanceIsolatedEnvironment do
  let(:skeleton_path) { Pathname.new(Dir.mktmpdir) }

  subject do
    described_class.new(
      skeleton_paths: [skeleton_path]
    )
  end

  after do
    FileUtils.rmtree(skeleton_path)
  end

  describe "skeleton" do
    it "raises an exception if the skeleton doesn't exist" do
      expect { subject.skeleton("foo") }.
        to raise_error(ArgumentError)
    end

    it "copies the skeleton directory" do
      path = skeleton_path.join("foo")
      path.mkpath
      path.join("bar").mkpath
      path.join("bar", "baz").open("w") { |f| f.write("baz") }
      path.join("foo").open("w") { |f| f.write("hello") }

      subject.skeleton("foo")

      d = subject.workdir
      expect(d.join("bar")).to be_directory
      expect(d.join("bar", "baz")).to be_file
      expect(d.join("bar", "baz").read).to eql("baz")
      expect(d.join("foo")).to be_file
      expect(d.join("foo").read).to eql("hello")
    end
  end
end

Version data entries

96 entries across 29 versions & 2 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-abfc34474d12/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-spec-abfc34474d12/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-03d88fe24677/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-b6b56c8b8135/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-148cb63d6d06/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-93c587f3c98a/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-b6b56c8b8135/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-b6b56c8b8135/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-148cb63d6d06/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-abfc34474d12/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-b6b56c8b8135/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-93c587f3c98a/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-spec-abfc34474d12/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-03d88fe24677/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/isolated_environment_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/isolated_environment_spec.rb