Sha256: e472a88fc25839e74d6dbac8a72ddaf0014b9dd83a7783db3397121419f88c90

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'
require 'puppet-debugger'
require 'puppet-debugger/plugin_test_helper'
require 'pluginator'

describe :vars do
  include_examples 'plugin_tests'
  let(:args) { [] }

  it 'display facts variable' do
    debugger_output = /facts/
    output = plugin.run(args)
    expect(output).to match(debugger_output)
  end
  it 'display server facts variable' do
    debugger_output = /server_facts/
    expect(plugin.run(args)).to match(debugger_output) if Puppet.version.to_f >= 4.1
  end
  it 'display serverversion variable' do
    debugger_output = /serverversion/
    expect(plugin.run(args)).to match(debugger_output) if Puppet.version.to_f >= 4.1
  end
  it 'display local variable' do
    debugger.handle_input("$var1 = 'value1'")
    expect(plugin.run(args)).to match(/value1/)
  end

  describe 'resource' do
    let(:input) do
      "$service_require = Package['httpd']"
    end
    it 'can process a resource' do
      debugger_output = /Facts/
      debugger.handle_input(input)
      expect(plugin.run(args)).to match(debugger_output)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
puppet-debugger-0.11.0 spec/input_responders/vars_spec.rb
puppet-debugger-0.10.3 spec/input_responders/vars_spec.rb
puppet-debugger-0.10.2 spec/input_responders/vars_spec.rb
puppet-debugger-0.10.1 spec/input_responders/vars_spec.rb
puppet-debugger-0.10.0 spec/input_responders/vars_spec.rb
puppet-debugger-0.9.1 spec/input_responders/vars_spec.rb
puppet-debugger-0.9.0 spec/input_responders/vars_spec.rb