Sha256: 6448fbd0034bb6286a80fd0f89767dfdc91f4f67fa7e2195506866b365c58667

Contents?: true

Size: 1.92 KB

Versions: 2

Compression:

Stored size: 1.92 KB

Contents

require 'spec_helper'

describe PuppetDocLint::DocRunner do

  context 'define_rdoc' do  

    file = 'spec/manifests/define_rdoc.pp'  
    subject { setup(file) }

    it 'result should be an array of PuppetDocLint::Result' do
      subject.class.should be(Array)
      subject[0].class.should be(PuppetDocLint::Result)
    end

    it 'file name should be defined' do
      subject[0].file_name.should eql 'spec/manifests/define_rdoc.pp'
    end

    it 'class should be define_rdoc ' do
      subject[0].class_name.should eql 'define_rdoc'
    end

    it 'all parameters should be defined' do
      subject[0].parameters.should eql ["param_one", "param_two", "param_three", "param_four"]
    end

    it 'no documentation is nil' do
      subject[0].no_documentation.should be_false
    end

    it 'documented parameters' do
      subject[0].documented_parameters.should eql ["param_one"]
    end

    it 'undocumented_parameters parameters' do
      subject[0].undocumented_parameters.should eql ["param_two", "param_three", "param_four"]
    end

  end

  context 'define_rdoc' do
    file = 'spec/manifests/nested_bullets.pp'  
    subject { setup(file) }

    it 'result should be an array of PuppetDocLint::Result' do
      subject.class.should be(Array)
      subject[0].class.should be(PuppetDocLint::Result)
    end

    it 'file name should be defined' do
      subject[0].file_name.should eql "spec/manifests/nested_bullets.pp"
    end

    it 'class should be foo' do
      subject[0].class_name.should eql 'foo'
    end

    it 'all parameters should be defined' do
      subject[0].parameters.should eql ["ensure"]
    end

    it 'no documentation is nil' do
      subject[0].no_documentation.should be_false
    end

    it 'documented parameters' do
      subject[0].documented_parameters.should eql ["ensure"]
    end

    it 'undocumented_parameters parameters' do
      subject[0].undocumented_parameters.should eql []
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-doc-lint-0.3.0 spec/runner_results_spec.rb
puppet-doc-lint-0.2.0 spec/runner_results_spec.rb