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