class Serverspec::Type::DockerContainer

Public Instance Methods

has_volume?(container_path, host_path) click to toggle source
# File lib/serverspec/type/docker_container.rb, line 7
def has_volume?(container_path, host_path)
  if (inspection['Mounts'])
    check_volume(container_path, host_path)
  else
    check_volume_pre_1_8(container_path, host_path)
  end
end
running?() click to toggle source
# File lib/serverspec/type/docker_container.rb, line 3
def running?
  inspection['State']['Running'] && !inspection['State']['Restarting']
end

Private Instance Methods

check_volume(container_path, host_path) click to toggle source
# File lib/serverspec/type/docker_container.rb, line 16
def check_volume(container_path, host_path)
  inspection['Mounts'].find {|mount|
    mount['Destination'] == container_path &&
    mount['Source'] == host_path
  }
end
check_volume_pre_1_8(container_path, host_path) click to toggle source
# File lib/serverspec/type/docker_container.rb, line 23
def check_volume_pre_1_8(container_path, host_path)
  inspection['Volumes'][container_path] == host_path
end