Sha256: b33b863c0935847ef743c79e7a3616c30ca52430a577e059a1b2047cd0327bda

Contents?: true

Size: 1.22 KB

Versions: 95

Compression:

Stored size: 1.22 KB

Contents

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

require "vagrant-spec/unit/isolated_environment"

describe Vagrant::Spec::UnitIsolatedEnvironment do
  describe "#create_vagrant_env" do
    it "creates a vagrant environment" do
      env = subject.create_vagrant_env
      expect(env.cwd).to eq(subject.workdir)
    end
  end

  describe "#box" do
    skip
  end

  describe "#box2" do
    skip
  end

  describe "#box3" do
    skip
  end

  describe "#box1_file" do
    skip
  end

  describe "#box2_file" do
    skip
  end

  describe "#file" do
    it "creates a file in the working directory" do
      subject.file("foo", "bar")

      path = subject.workdir.join("foo")
      expect(path).to be_file
      expect(path.read).to eq("bar")
    end
  end

  describe "#vagrantfile" do
    it "creates a Vagrantfile" do
      subject.vagrantfile("foo")

      path = subject.workdir.join("Vagrantfile")
      expect(path).to be_file
      expect(path.read).to eq("foo")
    end

    it "creates a Vagrantfile in the specified directory" do
      dir = Pathname.new(Dir.mktmpdir)

      subject.vagrantfile("foo", dir)

      path = dir.join("Vagrantfile")
      expect(path).to be_file
      expect(path.read).to eq("foo")
    end
  end
end

Version data entries

95 entries across 28 versions & 1 rubygems

Version Path
vagrant-unbundled-2.1.4.0 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-94a9d31ba18b/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.1.4.0 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-f3daedaac493/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-spec-94a9d31ba18b/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.1.1.0 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-f3daedaac493/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.0.4.0 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-f3daedaac493/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.0.3.0 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-f3daedaac493/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-af86757912f7/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-1.9.8.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-1.9.7.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/unit/isolated_environment_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/unit/isolated_environment_spec.rb