File: 002_jvm.options.erb_spec.rb

package info (click to toggle)
puppet-module-voxpupuli-elasticsearch 9.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,496 kB
  • sloc: ruby: 9,906; sh: 392; makefile: 4
file content (40 lines) | stat: -rw-r--r-- 702 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

require 'spec_helper'

describe 'jvm.options.epp' do
  let :harness do
    TemplateHarness.new(
      'templates/etc/elasticsearch/jvm.options.d/jvm.options.epp'
    )
  end

  it 'render the same string each time' do
    harness.set(
      '@_sorted_jvm_options', [
        '-Xms2g',
        '-Xmx2g'
      ]
    )

    first_render = harness.run
    second_render = harness.run

    expect(first_render).to eq(second_render)
  end

  it 'test content' do
    harness.set(
      '@_sorted_jvm_options', [
        '-Xms2g',
        '-Xmx2g'
      ]
    )

    expect(harness.run).to eq(%(
      ### MANAGED BY PUPPET ###
      -Xms2g
      -Xmx2g
    ).config)
  end
end