X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fsource_spec.rb;h=9cec5802d0f9d80b8556184559959d6c3a89a87f;hb=fd53569ee8a3c16ba5f9ab1b5ae9782290e5f168;hp=52a7ca9e9cf64b398df1b443e7c54e05fa33ec22;hpb=90f5fdbce44d5fe61a70fb2129e01785e95c3218;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index 52a7ca9..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{expects a value}) + is_expected.to raise_error(Puppet::Error, %r{expects a value}) end end