Skip to content

Instantly share code, notes, and snippets.

@ianblenke
Created November 10, 2014 20:07
Show Gist options
  • Save ianblenke/261e6fe930c922202151 to your computer and use it in GitHub Desktop.
Save ianblenke/261e6fe930c922202151 to your computer and use it in GitHub Desktop.
Dockerfile TDD spec
require "spec_helper"
describe "dockerfile built my_app image" do
before(:all) do
@image = Docker::Image.all(:all => true).find { |image|
Docker::Util.parse_repo_tag( image.info['RepoTags'].first ).first == 'my_app'
}
p @image.json["Env"]
end
it "should exist" do
expect(@image).not_to be_nil
end
it "should have CMD" do
expect(@image.json["Config"]["Cmd"]).to include("/run.sh")
end
it "should expose the default port" do
expect(@image.json["Config"]["ExposedPorts"].has_key?("3000/tcp")).to be_truthy
end
it "should have environmental variable" do
expect(@image.json["Config"]["Env"]).to include("HOME=/usr/src/app")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment