Sha256: 27acc352bbe9719fdbc9d49c8649e2e473807a237cf875911c006886ca799ff9

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

describe 'pdb' do
  let(:fixtures_file) do
    File.join(fixtures_dir, 'sample_manifest.pp')
  end

  before(:each) do
    allow(PuppetDebugger).to receive(:fetch_url_data).with(file_url).and_return(File.read(fixtures_file))
  end

  let(:file_url) do
    'https://gist.githubusercontent.com/logicminds/f9b1ac65a3a440d562b0/raw'
  end

  it do
    expect(`echo 'file{"/tmp/test":}'| bundle exec bin/pdb`)
      .to match(/Puppet::Type::File/)
  end

  it do
    expect(`bundle exec bin/pdb #{fixtures_file} --run-once`)
      .to match(/Puppet::Type::File/)
  end
  it do
    expect(`bundle exec bin/pdb --play #{fixtures_file} --run-once`)
      .to match(/Puppet::Type::File/)
  end
  # xit do
  #   # this test does not work without internet, and I am at 30K feet right now
  #   expect(`bundle exec bin/pdb --play #{file_url} --run-once`)
  #     .to match(/Puppet::Type::File/)
  # end

  describe 'remote_node' do
    let(:node_obj) do
      YAML.load_file(File.join(fixtures_dir, 'node_obj.yaml'))
    end
    let(:node_name) do
      'puppetdev.localdomain'
    end
    before :each do
      allow(PuppetDebugger).to receive(:get_remote_node).with(node_name).and_return(node_obj)
    end
    # xit do
    #   expect(`echo 'vars'| bundle exec bin/pdb -n #{node_name}`)
    #     .to match(/server_facts/)
    # end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-debugger-0.4.1 spec/pdb_spec.rb
puppet-debugger-0.4.0 spec/pdb_spec.rb