spec/dockly/build_cache/docker_spec.rb in dockly-1.9.0 vs spec/dockly/build_cache/docker_spec.rb in dockly-1.10.0
- old
+ new
@@ -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 { |source,chunk| output += chunk }
+ i.run('ls').attach(logs: true) { |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)
- output.first.first.lines.map(&:chomp).should include('lol')
+ output = i.run('ls /').attach(stdout: true, logs: true)
+ expect(output.first.grep(/lol/)).to_not be_empty
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 { |source,chunk| output += chunk }
+ i.run('ls').attach(logs: true) { |source,chunk| output += chunk }
output.should include('lol')
end
end
context "when the build fails" 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{2}-generic\Z/)
+ expect(build_cache.parameter_output(command)).to match(/\A3\.\d{2}\.\d-\d{1,2}-\w+\Z/)
end
end
context "when parameter command returns failure" do
let(:command) { 'md6sum' }