require File.expand_path("../base", __FILE__) require "net/http" require "uri" require "vagrant/util/retryable" require "acceptance/support/shared/command_examples" describe "vagrant port forwarding" do include Vagrant::Util::Retryable include_context "acceptance" it "forwards ports properly" do require_box("default") guest_port = 3000 host_port = 5000 environment.workdir.join("Vagrantfile").open("w+") do |f| f.puts(< 5, :sleep => 2) do result = Net::HTTP.get_response(URI.parse("http://localhost:#{host_port}/")) result.code.should == "200" end ensure # The server needs to die. This is how. thr.kill if thr end end end