Sha256: 3d93f1c6f9b68951b6f1aa1ef7d5749de1d27132348e6a2fc70912cd3eb6d81e

Contents?: true

Size: 1.28 KB

Versions: 19

Compression:

Stored size: 1.28 KB

Contents

require "vagrant-spec/acceptance/isolated_environment"

describe Vagrant::Spec::AcceptanceIsolatedEnvironment do
  after do
    subject.close
  end

  describe "execute" do
    it "should execute the command and return the result" do
      Vagrant::Spec::Which.stub(which: "vagrant")

      result = Object.new
      expect(Vagrant::Spec::Subprocess).to receive(:execute) do |command, *args, **options|
        expect(command).to eql("vagrant")
        expect(args).to eql(["up"])

        expect(options[:env].has_key?("HOME")).to be_truthy
        expect(options[:workdir]).to eql(subject.workdir.to_s)
      end.and_return(result)

      expect(subject.execute("vagrant", "up")).to eql(result)
    end

    it "should replace app paths" do
      Vagrant::Spec::Which.stub(which: "/bin/foo")

      subject = described_class.new(apps: {
        "vagrant" => "/bin/foo",
      })

      result = Object.new
      expect(Vagrant::Spec::Subprocess).to receive(:execute) do |command, *args, **options|
        expect(command).to eql("/bin/foo")
        expect(args).to eql(["up"])

        expect(options[:env].has_key?("HOME")).to be_truthy
        expect(options[:workdir]).to eql(subject.workdir.to_s)
      end.and_return(result)

      expect(subject.execute("vagrant", "up")).to eql(result)
    end
  end
end

Version data entries

19 entries across 10 versions & 1 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-9bba7e122837/spec/acceptance/shared/isolated_environment_spec.rb