spec/dockly/build_cache/docker_spec.rb in dockly-1.13.0 vs spec/dockly/build_cache/docker_spec.rb in dockly-2.0.0

- old
+ new

@@ -5,11 +5,11 @@ let!(:docker) do Dockly::Docker.new!(:name => :test_docker) do git_archive '/app' end end - let(:image) { ::Docker::Image.build('from ubuntu:14.04') } + let(:image) { ::Docker::Image.build('from base') } before do build_cache.s3_bucket 'lol' build_cache.s3_object_prefix 'swag' build_cache.image = image @@ -44,11 +44,11 @@ let(:up_to_date) { true } it "does not have the file lol" do i = build_cache.execute! output = "" - i.run('ls').attach(logs: true) { |source,chunk| output += chunk } + i.run('ls').attach { |source,chunk| output += chunk } output.should_not include('lol') end end context 'when the object is not up to date' do @@ -58,12 +58,12 @@ build_cache.stub(:copy_output_dir) { StringIO.new } end it "does have the file lol" do i = build_cache.execute! - output = i.run('ls /').attach(stdout: true, logs: true) - expect(output.first.grep(/lol/)).to_not be_empty + output = i.run('ls /').attach(:stdout => true) + output.first.first.lines.map(&:chomp).should include('lol') end end end describe "#run_build" do @@ -73,11 +73,11 @@ context "when the build succeeds" do it "does have the file lol" do i = build_cache.run_build output = "" - i.run('ls').attach(logs: true) { |source,chunk| output += chunk } + i.run('ls').attach { |source,chunk| output += chunk } output.should include('lol') end end context "when the build fails" do @@ -98,11 +98,11 @@ end end describe '#hash_output' do let(:output) { - "b458e7b28b9bc2d04bd5a3fd0f8d777e /etc/vim/vimrc" + "682aa2a07693cc27756eee9751db3903 /etc/vim/vimrc" } context "when hash command returns successfully" do before do build_cache.image = image @@ -125,11 +125,11 @@ end end end describe '#copy_output_dir' do - let(:container) { Docker::Container.create('Image' => 'ubuntu:14.04', 'Cmd' => %w[true]) } + let(:container) { Docker::Container.create('Image' => 'base', 'Cmd' => %w[true]) } let(:file) { build_cache.copy_output_dir(container) } let(:hash) { 'this_really_unique_hash' } let(:path) { file.path } before do @@ -154,10 +154,10 @@ end context "when parameter command returns successfully" do let(:command) { "uname -r" } it 'returns the output of the parameter_command' do - expect(build_cache.parameter_output(command)).to match(/\A3\.\d{2}\.\d-\d{1,2}-\w+\Z/) + expect(build_cache.parameter_output(command)).to match(/\A3\.\d{2}\.\d-\d-ARCH\Z/) end end context "when parameter command returns failure" do let(:command) { 'md6sum' }