require 'picsolve_docker_builder/helpers/repository' require 'docker' require 'open3' def sh(command) env = { 'PATH' => ENV['PATH'], 'GEM_PATH' => ENV['GEM_PATH'] } Open3.popen3( env, command, unsetenv_others: true ) do |stdin, stdout, stderr, wait_thr| stdin.close stdout.each_line do |line| $stdout.write(line) $stdout.flush end stderr.each_line do |line| $stderr.write(line) $stderr.flush end exit_status = wait_thr.value fail 'Exit code is not zero' if exit_status != 0 end end describe 'Integration tests' do before(:each) do begin Docker.info.inspect rescue Excon::Errors::Error skip 'No docker daemon available' end end describe 'docker build' do describe 'play hello world' do let :path do 'integration/play_hello_world' end it 'builds successfully' do Dir.chdir(path) do sh 'rm -f Gemfile.lock' sh 'bundle install' sh 'bundle exec rake docker:build' end end end end end