Skip to content

Commit

Permalink
Add tests for image_name downcase
Browse files Browse the repository at this point in the history
  • Loading branch information
andreionut committed Nov 23, 2015
1 parent 8246edd commit 81459ae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions plugins/docker_binary_builder/test/models/binary_builder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe '#build' do
let(:project) { projects(:test) }
let(:dir) { '/tmp' }
let(:reference) { 'abc' }
let(:reference) { 'aBc-19F' }
let(:output) { StringIO.new }
let(:builder) { BinaryBuilder.new(dir, project, reference, output) }
let(:fake_image) { stub(remove: true) }
Expand Down Expand Up @@ -47,7 +47,7 @@
builder.send(:create_container_options).must_equal(
{
'Cmd' => ['/app/build.sh'],
'Image' => 'foo_build:abc',
'Image' => 'foo_build:abc-19f',
'Volumes' => { '/opt/samson_build_cache' => {} },
'HostConfig' => {
'Binds' => ['/opt/samson_build_cache:/build/cache'],
Expand All @@ -62,7 +62,7 @@
builder.send(:create_container_options).must_equal(
{
'Cmd' => ['/app/build.sh'],
'Image' => 'foo_build:abc',
'Image' => 'foo_build:abc-19f',
'Mounts' => [
{
'Source' => '/opt/samson_build_cache',
Expand All @@ -82,5 +82,10 @@
Docker.stubs(:version).returns({ 'ApiVersion' => '1.14' })
proc { builder.send(:create_container_options) }.must_raise RuntimeError
end

it 'downcases the image name' do
image_name = builder.send(:image_name)
image_name.must_equal(image_name.downcase)
end
end
end

0 comments on commit 81459ae

Please sign in to comment.