Merge pull request #3673 from mitchellh/rename-docker-provider-specs
providers/docker: Rename test files for consistency
This commit is contained in:
commit
7a1dc1e527
|
@ -29,7 +29,7 @@ module VagrantPlugins
|
||||||
|
|
||||||
def create(params, **opts, &block)
|
def create(params, **opts, &block)
|
||||||
image = params.fetch(:image)
|
image = params.fetch(:image)
|
||||||
links = params.fetch(:links)
|
links = Array(params.fetch(:links))
|
||||||
ports = Array(params[:ports])
|
ports = Array(params[:ports])
|
||||||
volumes = Array(params[:volumes])
|
volumes = Array(params[:volumes])
|
||||||
name = params.fetch(:name)
|
name = params.fetch(:name)
|
||||||
|
@ -41,7 +41,7 @@ module VagrantPlugins
|
||||||
run_cmd << "-d" if params[:detach]
|
run_cmd << "-d" if params[:detach]
|
||||||
run_cmd += env.map { |k,v| ['-e', "#{k}=#{v}"] }
|
run_cmd += env.map { |k,v| ['-e', "#{k}=#{v}"] }
|
||||||
run_cmd += expose.map { |p| ['--expose', "#{p}"] }
|
run_cmd += expose.map { |p| ['--expose', "#{p}"] }
|
||||||
run_cmd += links.map { |k, v| ['--link', "#{k}:#{v}"] }
|
run_cmd += links.map { |l| ['--link', "#{l}"] }
|
||||||
run_cmd += ports.map { |p| ['-p', p.to_s] }
|
run_cmd += ports.map { |p| ['-p', p.to_s] }
|
||||||
run_cmd += volumes.map { |v| ['-v', v.to_s] }
|
run_cmd += volumes.map { |v| ['-v', v.to_s] }
|
||||||
run_cmd += %W(--privileged) if params[:privileged]
|
run_cmd += %W(--privileged) if params[:privileged]
|
||||||
|
|
|
@ -16,6 +16,9 @@ describe VagrantPlugins::DockerProvider::Driver do
|
||||||
cmd: ['play', 'voodoo-chile'],
|
cmd: ['play', 'voodoo-chile'],
|
||||||
ports: '8080:80',
|
ports: '8080:80',
|
||||||
volumes: '/host/path:guest/path',
|
volumes: '/host/path:guest/path',
|
||||||
|
detach: true,
|
||||||
|
links: 'janis:joplin',
|
||||||
|
env: {key: 'value'},
|
||||||
name: cid,
|
name: cid,
|
||||||
hostname: 'jimi-hendrix',
|
hostname: 'jimi-hendrix',
|
||||||
privileged: true
|
privileged: true
|
||||||
|
@ -28,7 +31,7 @@ describe VagrantPlugins::DockerProvider::Driver do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sets container name' do
|
it 'sets container name' do
|
||||||
expect(cmd_executed).to match(/-name #{Regexp.escape params[:name]}/)
|
expect(cmd_executed).to match(/--name #{Regexp.escape params[:name]}/)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'forwards ports' do
|
it 'forwards ports' do
|
||||||
|
@ -39,8 +42,16 @@ describe VagrantPlugins::DockerProvider::Driver do
|
||||||
expect(cmd_executed).to match(/-v #{params[:volumes]} .+ #{Regexp.escape params[:image]}/)
|
expect(cmd_executed).to match(/-v #{params[:volumes]} .+ #{Regexp.escape params[:image]}/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'links containers' do
|
||||||
|
expect(cmd_executed).to match(/--link #{params[:links]} .+ #{Regexp.escape params[:image]}/)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'sets environmental variables' do
|
||||||
|
expect(cmd_executed).to match(/-e key=value .+ #{Regexp.escape params[:image]}/)
|
||||||
|
end
|
||||||
|
|
||||||
it 'is able to run a privileged container' do
|
it 'is able to run a privileged container' do
|
||||||
expect(cmd_executed).to match(/-privileged .+ #{Regexp.escape params[:image]}/)
|
expect(cmd_executed).to match(/--privileged .+ #{Regexp.escape params[:image]}/)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sets the hostname if specified' do
|
it 'sets the hostname if specified' do
|
Loading…
Reference in New Issue