X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fsource_spec.rb;h=9cec5802d0f9d80b8556184559959d6c3a89a87f;hb=fd53569ee8a3c16ba5f9ab1b5ae9782290e5f168;hp=eaa08874ef932ca8b37fca6c94d119908d5e77c9;hpb=f610bedc5f33db5fdee2ad49eeda95268ab0b9a5;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index eaa0887..9cec580 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -23,9 +23,7 @@ describe 'apt::source' do end it do - expect { - subject.call - }.to raise_error(Puppet::Error, %r{source entry without specifying a location}) + is_expected.to raise_error(Puppet::Error, %r{source entry without specifying a location}) end end context 'with location' do @@ -98,7 +96,8 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(/# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(%r{deb-src}) # rubocop:disable Metrics/LineLength + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# foo\ndeb \[arch=x86_64 trusted=yes\] http://debian.mirror.iweb.ca/debian/ sid testing\n}) + .without_content(%r{deb-src}) } it { @@ -130,7 +129,8 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(/# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(%r{deb-src}) # rubocop:disable Metrics/LineLength + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# foo\ndeb \[arch=x86_64 trusted=yes\] http://debian.mirror.iweb.ca/debian/ sid testing\n}) + .without_content(%r{deb-src}) } it { @@ -163,7 +163,8 @@ describe 'apt::source' do end it { - is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(/# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(%r{deb-src}) # rubocop:disable Metrics/LineLength + is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# foo\ndeb \[arch=x86_64 trusted=yes\] http://debian.mirror.iweb.ca/debian/ sid testing\n}) + .without_content(%r{deb-src}) } it { @@ -349,9 +350,7 @@ describe 'apt::source' do let(:params) { { location: 'hello.there' } } it do - expect { - subject.call - }.to raise_error(Puppet::Error, %r{lsbdistcodename fact not available: release parameter required}) + is_expected.to raise_error(Puppet::Error, %r{lsbdistcodename fact not available: release parameter required}) end end @@ -387,9 +386,7 @@ describe 'apt::source' do end it do - expect { - subject.call - }.to raise_error(Puppet::Error, %r{invalid value for pin}) + is_expected.to raise_error(Puppet::Error, %r{expects a value}) end end