Created
November 10, 2014 20:07
-
-
Save ianblenke/261e6fe930c922202151 to your computer and use it in GitHub Desktop.
Dockerfile TDD spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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