Sha256: b98169f1a68b95e90680b5267576562b81f46d2a790e2b6fa5a5db2f3ccc6953

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'
require 'puppet-debugger/input_responder_plugin'

describe :input_responder_plugin do
  let(:output) do
    StringIO.new
  end

  before(:each) do
    allow(plugin).to receive(:run).and_return([])
  end

  let(:debugger) do
    PuppetDebugger::Cli.new({ out_buffer: output }.merge(options))
  end

  let(:options) do
    {}
  end

  let(:plugin) do
    instance = PuppetDebugger::InputResponderPlugin.instance
    instance.debugger = debugger
    instance
  end

  it 'works' do
    expect(plugin.run([])).to eq([])
  end

  {scope: Puppet::Parser::Scope, node: Puppet::Node, facts: Puppet::Node::Facts,
   environment: Puppet::Node::Environment, function_map: Hash,
  compiler: Puppet::Parser::Compiler, catalog: Puppet::Resource::Catalog}.each do |name, klass|
    it "can access #{name}" do
      expect(plugin.send(name).class).to be klass
    end
  end

  [:add_hook, :handle_input, :delete_hook, :handle_input].each do |name|
    it "responds to method #{name}" do
      expect(plugin.respond_to?(name)).to eq(true)
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
puppet-debugger-0.10.3 spec/input_responder_plugin_spec.rb
puppet-debugger-0.10.2 spec/input_responder_plugin_spec.rb
puppet-debugger-0.10.1 spec/input_responder_plugin_spec.rb
puppet-debugger-0.10.0 spec/input_responder_plugin_spec.rb
puppet-debugger-0.9.1 spec/input_responder_plugin_spec.rb
puppet-debugger-0.9.0 spec/input_responder_plugin_spec.rb
puppet-debugger-0.8.1 spec/input_responder_plugin_spec.rb
puppet-debugger-0.8.0 spec/input_responder_plugin_spec.rb
puppet-debugger-0.7.0 spec/input_responder_plugin_spec.rb