Ignore:
Timestamp:
Aug 1, 2017, 3:45:14 PM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, debian/jessie
Children:
ce0f6a4
Parents:
bcf0be5 (diff), cd0f9cc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into debian/jessie

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_string_spec.rb

    rbcf0be5 rad28f83  
    22
    33describe 'is_string' do
     4
    45  it { is_expected.not_to eq(nil) }
    56  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
    … …  
    2627  it { is_expected.to run.with_params('one').and_return(true) }
    2728  it { is_expected.to run.with_params('0001234').and_return(true) }
     29
     30  context 'Checking for deprecation warning' do
     31    after(:all) do
     32      ENV.delete('STDLIB_LOG_DEPRECATIONS')
     33    end
     34    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
     35    it 'should display a single deprecation' do
     36      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
     37      scope.expects(:warning).with(includes('This method is deprecated'))
     38      is_expected.to run.with_params('sponge').and_return(true)
     39    end
     40    it 'should display no warning for deprecation' do
     41      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
     42      scope.expects(:warning).with(includes('This method is deprecated')).never
     43      is_expected.to run.with_params('bob').and_return(true)
     44    end
     45  end
     46
    2847end
Note: See TracChangeset for help on using the changeset viewer.