Skip to content

rspec-puppet doesn’t handle private classes well #982

@natemccurdy

Description

@natemccurdy

I have a lot of classes in modules that are marked private with assert_private().
When I convert those modules with pdk convert, tests fail because of that function.

I've had to add this stub to a lot of my spec tests so that even basic "it should compile" tests pass:

before(:each) do
  # Fake assert_private function from stdlib to not fail within this test
  Puppet::Parser::Functions.newfunction(:assert_private, :type => :rvalue) { |args| }
end

Can anything be done to make this more user friendly? Maybe rspec-puppet can intelligently stub that out behind the scenes or maybe PDK can insert that stub when converting a private class?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions