Skip to content

Commit

Permalink
missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Oct 25, 2017
1 parent ee5f40d commit 9f9a9c4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugins/aws_ecr/test/samson_aws_ecr/samson_plugin_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def clear_client
end

describe :before_docker_repository_usage do
let(:build) { builds(:docker_build) }

def fire
Samson::Hooks.fire(:before_docker_repository_usage, builds(:docker_build))
Samson::Hooks.fire(:before_docker_repository_usage, build)
end

run_inside_of_temp_directory
Expand Down Expand Up @@ -99,6 +101,12 @@ def fire
fire
end

it 'derives repository from dockerfile' do
build.update_column :dockerfile, 'Dockerfile.foobar'
ecr_client.expects(:describe_repositories).with(repository_names: ['foo-foobar'])
fire
end

it 'does nothing when repository already exists' do
ecr_client.
expects(:describe_repositories).
Expand Down

0 comments on commit 9f9a9c4

Please sign in to comment.