X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fclasses%2Fapt_backports_spec.rb;h=e7a951a7583fdcb908c678710223a367bca1fa47;hb=refs%2Fheads%2Ftrusted-contributors;hp=2ae8429478775dc4c55f2eee0e5089365710fe09;hpb=ec7f4e29c6f57ee9250c65432ee0051282367760;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/classes/apt_backports_spec.rb b/spec/classes/apt_backports_spec.rb index 2ae8429..e7a951a 100644 --- a/spec/classes/apt_backports_spec.rb +++ b/spec/classes/apt_backports_spec.rb @@ -14,21 +14,21 @@ describe 'apt::backports', type: :class do name: 'Debian', release: { major: '9', - full: '9.0', + full: '9.0' }, distro: { codename: 'stretch', - id: 'Debian', - }, - }, + id: 'Debian' + } + } } end it { - is_expected.to contain_apt__source('backports').with(location: 'http://deb.debian.org/debian', - repos: 'main contrib non-free', - release: 'stretch-backports', - pin: { 'priority' => 200, 'release' => 'stretch-backports' }) + expect(subject).to contain_apt__source('backports').with(location: 'http://deb.debian.org/debian', + repos: 'main contrib non-free', + release: 'stretch-backports', + pin: { 'priority' => 200, 'release' => 'stretch-backports' }) } end @@ -40,22 +40,22 @@ describe 'apt::backports', type: :class do name: 'Ubuntu', release: { major: '18', - full: '18.04', + full: '18.04' }, distro: { codename: 'bionac', - id: 'Ubuntu', - }, - }, + id: 'Ubuntu' + } + } } end it { - is_expected.to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', - repos: 'main universe multiverse restricted', - release: 'bionac-backports', - pin: { 'priority' => 200, 'release' => 'bionac-backports' }) + expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', + key: '630239CC130E1A7FD81A27B140976EAF437D05B5', + repos: 'main universe multiverse restricted', + release: 'bionac-backports', + pin: { 'priority' => 200, 'release' => 'bionac-backports' }) } end @@ -67,13 +67,13 @@ describe 'apt::backports', type: :class do name: 'Ubuntu', release: { major: '18', - full: '18.04', + full: '18.04' }, distro: { codename: 'bionac', - id: 'Ubuntu', - }, - }, + id: 'Ubuntu' + } + } } end let(:params) do @@ -82,16 +82,16 @@ describe 'apt::backports', type: :class do release: 'vivid', repos: 'main', key: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', - pin: '90', + pin: '90' } end it { - is_expected.to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu-test', - key: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', - repos: 'main', - release: 'vivid', - pin: { 'priority' => 90, 'release' => 'vivid' }) + expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu-test', + key: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', + repos: 'main', + release: 'vivid', + pin: { 'priority' => 90, 'release' => 'vivid' }) } end @@ -103,29 +103,29 @@ describe 'apt::backports', type: :class do name: 'Ubuntu', release: { major: '18', - full: '18.04', + full: '18.04' }, distro: { codename: 'bionac', - id: 'Ubuntu', - }, - }, + id: 'Ubuntu' + } + } } end let(:params) do { key: { - 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', + 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' }, pin: { - 'priority' => '90', - }, + 'priority' => '90' + } } end it { - is_expected.to contain_apt__source('backports').with(key: { 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' }, - pin: { 'priority' => '90' }) + expect(subject).to contain_apt__source('backports').with(key: { 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' }, + pin: { 'priority' => '90' }) } end end @@ -138,13 +138,13 @@ describe 'apt::backports', type: :class do name: 'LinuxMint', release: { major: '17', - full: '17', + full: '17' }, distro: { codename: 'qiana', - id: 'LinuxMint', - }, - }, + id: 'LinuxMint' + } + } } end @@ -154,16 +154,16 @@ describe 'apt::backports', type: :class do location: 'http://archive.ubuntu.com/ubuntu', release: 'trusty-backports', repos: 'main universe multiverse restricted', - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', + key: '630239CC130E1A7FD81A27B140976EAF437D05B5' } end it { - is_expected.to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', - repos: 'main universe multiverse restricted', - release: 'trusty-backports', - pin: { 'priority' => 200, 'release' => 'trusty-backports' }) + expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', + key: '630239CC130E1A7FD81A27B140976EAF437D05B5', + repos: 'main universe multiverse restricted', + release: 'trusty-backports', + pin: { 'priority' => 200, 'release' => 'trusty-backports' }) } end @@ -172,12 +172,12 @@ describe 'apt::backports', type: :class do { release: 'trusty-backports', repos: 'main universe multiverse restricted', - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', + key: '630239CC130E1A7FD81A27B140976EAF437D05B5' } end it do - is_expected.to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) + expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) end end @@ -186,12 +186,12 @@ describe 'apt::backports', type: :class do { location: 'http://archive.ubuntu.com/ubuntu', repos: 'main universe multiverse restricted', - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', + key: '630239CC130E1A7FD81A27B140976EAF437D05B5' } end it do - is_expected.to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) + expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) end end @@ -200,12 +200,12 @@ describe 'apt::backports', type: :class do { location: 'http://archive.ubuntu.com/ubuntu', release: 'trusty-backports', - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', + key: '630239CC130E1A7FD81A27B140976EAF437D05B5' } end it do - is_expected.to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) + expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) end end @@ -214,12 +214,12 @@ describe 'apt::backports', type: :class do { location: 'http://archive.ubuntu.com/ubuntu', release: 'trusty-backports', - repos: 'main universe multiverse restricted', + repos: 'main universe multiverse restricted' } end it do - is_expected.to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) + expect(subject).to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key}) end end end @@ -232,73 +232,73 @@ describe 'apt::backports', type: :class do name: 'Ubuntu', release: { major: '18', - full: '18.04', + full: '18.04' }, distro: { codename: 'bionac', - id: 'Ubuntu', - }, - }, + id: 'Ubuntu' + } + } } end context 'with invalid location' do let(:params) do { - location: true, + location: true } end it do - is_expected.to raise_error(Puppet::Error, %r{expects a}) + expect(subject).to raise_error(Puppet::Error, %r{expects a}) end end context 'with invalid release' do let(:params) do { - release: true, + release: true } end it do - is_expected.to raise_error(Puppet::Error, %r{expects a}) + expect(subject).to raise_error(Puppet::Error, %r{expects a}) end end context 'with invalid repos' do let(:params) do { - repos: true, + repos: true } end it do - is_expected.to raise_error(Puppet::Error, %r{expects a}) + expect(subject).to raise_error(Puppet::Error, %r{expects a}) end end context 'with invalid key' do let(:params) do { - key: true, + key: true } end it do - is_expected.to raise_error(Puppet::Error, %r{expects a}) + expect(subject).to raise_error(Puppet::Error, %r{expects a}) end end context 'with invalid pin' do let(:params) do { - pin: true, + pin: true } end it do - is_expected.to raise_error(Puppet::Error, %r{expects a}) + expect(subject).to raise_error(Puppet::Error, %r{expects a}) end end end