Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec fix #105

Merged
merged 2 commits into from
Jan 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ task :test => [
:syntax,
:lint,
:metadata_lint,
:spec,
]
20 changes: 10 additions & 10 deletions spec/defines/registry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,51 @@
:kernelrelease => '3.2.0-4-amd64',
:operatingsystemmajrelease => '8',
} }
let(:params) { { 'version' => '17.06' } }
let(:params) { { 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth') }

context 'with ensure => present' do
let(:params) { { 'ensure' => 'absent', 'version' => '17.06' } }
let(:params) { { 'ensure' => 'absent', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command('docker logout localhost:5000') }
end

context 'with ensure => present' do
let(:params) { { 'ensure' => 'present', 'version' => '17.06' } }
let(:params) { { 'ensure' => 'present', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') }
end

context 'with ensure => present and username => user1' do
let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'version' => '17.06' } }
let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') }
end

context 'with ensure => present and password => secret' do
let(:params) { { 'ensure' => 'present', 'password' => 'secret', 'version' => '17.06' } }
let(:params) { { 'ensure' => 'present', 'password' => 'secret', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') }
end

context 'with ensure => present and email => user1@example.io' do
let(:params) { { 'ensure' => 'present', 'email' => 'user1@example.io', 'version' => '17.06' } }
let(:params) { { 'ensure' => 'present', 'email' => 'user1@example.io', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') }
end

context 'with ensure => present and username => user1, and password => secret and email => user1@example.io' do
let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '17.06' } }
let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" localhost:5000").with_environment('password=secret') }
end

context 'with ensure => present and username => user1, and password => secret and email => user1@example.io and version < 1.11.0' do
let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '1.9.0' } }
let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '1.9.0', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" -e 'user1@example.io' localhost:5000").with_environment('password=secret') }
end

context 'with username => user1, and password => secret' do
let(:params) { { 'username' => 'user1', 'password' => 'secret', 'version' => '17.06' } }
let(:params) { { 'username' => 'user1', 'password' => 'secret', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" localhost:5000").with_environment('password=secret') }
end

context 'with username => user1, and password => secret and local_user => testuser' do
let(:params) { { 'username' => 'user1', 'password' => 'secret', 'local_user' => 'testuser', 'version' => '17.06' } }
let(:params) { { 'username' => 'user1', 'password' => 'secret', 'local_user' => 'testuser', 'version' => '17.06', 'pass_hash' => 'test1234' } }
it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" localhost:5000").with_user('testuser').with_environment('password=secret') }
end

Expand Down