Last active
May 8, 2017 01:49
-
-
Save maxdanilov/17be29ef3b31fdcf70bec0b864632ef3 to your computer and use it in GitHub Desktop.
[Serverspec] running tests inside a Docker container
This file contains 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' | |
# the root folder should contain Dockerfile so build_from_dir can work | |
describe "mycontainer" do | |
before(:all) do | |
image = Docker::Image.build_from_dir('.') | |
@container = image.run() | |
set :os, family: :debian | |
set :backend, :docker | |
set :docker_container, @container.id | |
end | |
describe command('sleep 1') do | |
its(:exit_status) { should eq 0 } | |
end | |
after(:all) do | |
@container.kill | |
@container.delete(:force => true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gemfile
for this: