Sha256: 67352c9514d793e92e199c1b15fa4ec42d20f7496da31caa48e8d6e31571b561

Contents?: true

Size: 1.12 KB

Versions: 22

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'
require 'puppet-debugger'

describe :exit do
  let(:args) { [] }

  xit 'exits' do
    expect{plugin.run(args)}.to eq('')
  end

  let(:plugin) do
    instance = PuppetDebugger::InputResponders::Commands.plugin_from_command(subject.to_s).instance
    instance.debugger = debugger
    instance
  end

  let(:output) do
    StringIO.new
  end

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

  let(:options) do
    {}
  end

  it "commands contant is an array" do
    expect(plugin.class::COMMAND_WORDS).to be_a(Array)
  end

  it "commands must contain at least one word" do
    expect(plugin.class::COMMAND_WORDS.count).to  be > 0
  end

  it "summary must be a string" do
    expect(plugin.class::SUMMARY).to be_a(String)
  end

  it 'implements run' do
    expect{plugin.run([])}.not_to raise_error(NotImplementedError)
  end

  it 'be looked up via any command words' do
    plugin.class::COMMAND_WORDS.each do |word|
      actual = PuppetDebugger::InputResponders::Commands.plugin_from_command(word.to_s).instance.class
      expect(actual).to eq(plugin.class)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
puppet-debugger-0.19.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.18.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.17.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.16.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.15.2 spec/input_responders/exit_spec.rb
puppet-debugger-0.15.1 spec/input_responders/exit_spec.rb
puppet-debugger-0.15.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.14.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.13.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.12.3 spec/input_responders/exit_spec.rb
puppet-debugger-0.12.2 spec/input_responders/exit_spec.rb
puppet-debugger-0.12.1 spec/input_responders/exit_spec.rb
puppet-debugger-0.12.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.11.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.10.3 spec/input_responders/exit_spec.rb
puppet-debugger-0.10.2 spec/input_responders/exit_spec.rb
puppet-debugger-0.10.1 spec/input_responders/exit_spec.rb
puppet-debugger-0.10.0 spec/input_responders/exit_spec.rb
puppet-debugger-0.9.1 spec/input_responders/exit_spec.rb
puppet-debugger-0.9.0 spec/input_responders/exit_spec.rb