Sha256: c72f6c8f174b93dd8ff092c78f2eeeb676b0d1aacc1746bff0eb5e25e2fe0fa0

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

shared_examples_for 'support explicit linux kernel parameter checking with integer' do |param, value|
  describe 'linux kernel parameter' do
    let(:stdout) { "#{value}\n" }

    context linux_kernel_parameter(param) do
      its(:value) { should eq value }
    end

    context linux_kernel_parameter(param) do
      its(:value) { should_not eq value + 1 }
    end
  end
end

shared_examples_for 'support explicit linux kernel parameter checking with string' do |param, value|
  describe 'linux kernel parameter' do
    let(:stdout) { "#{value}\n" }

    context linux_kernel_parameter(param) do
      its(:value) { should eq value }
    end

    context linux_kernel_parameter(param) do
      its(:value) { should_not eq value + '_suffix' }
    end
  end
end

shared_examples_for 'support explicit linux kernel parameter checking with regexp' do |param, regexp|
  describe 'linux kernel parameter' do
    let(:stdout) { "4096	16384	4194304\n" }

    context linux_kernel_parameter(param) do
      its(:value) { should match regexp }
    end

    context linux_kernel_parameter(param) do
      its(:value) { should_not match /invalid-string/ }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
serverspec-0.6.16 spec/support/shared_linux_kernel_parameter_examples.rb
serverspec-0.6.15 spec/support/shared_linux_kernel_parameter_examples.rb
serverspec-0.6.13 spec/support/shared_linux_kernel_parameter_examples.rb