Commit Graph

126 Commits

Author SHA1 Message Date
Hailee Kenney 0a3c37373c (maint) Update Gemfile to use rspec 2.14.0
Prior to this commit, the Gemfile for strings did not specify which
version of rspec to use. When it started using rspec 3, the tests
that relied upon the rspec-html-matchers gem began to fail, likely
because that gem is not yet compatible with the new version of rspec.

Update the Gemfile so that we explicitly use an older version of
rspec to prevent tests from failing. We will have to either wait
for rspec-html-matchers to catch up or find a new way of testing
the HTML output before we can update to rspec 3.
2015-02-13 15:53:22 -08:00
Hailee Kenney 5257ca4bed (PDOC-27) Don't require options for 3x functions
Prior to this commit, the 3x function handler assumed that at
least two arguments (the name and one or more additional arguments)
were passed into newfunction when creating a 3x function. However
that is not actually required, the only argument needed is the name.

Update the 3x function handler so that it will not throw and exception
if only one argument is given.
2015-02-12 14:22:53 -08:00
Hailee Kenney e5691d23c7 (PDOC-26) Rename Puppetx to PuppetX
Due to the changes in PUP-3900 which renamed Puppetx to PuppetX
and puppetx to puppet_x, strings was failing since the namespace
had not been updated in strings. In order to be compatible with this
change, update strings by renaming the namespace to match.

In order to ensure strings is still compatible with earlier versions
of puppet that don't include the namespace change, declare our own
PuppetX module. This way, if it is an older version and the namespace
is called Puppetx, the necessary PuppetX namespace will be created.
2015-02-06 14:08:42 -08:00
Hailee Kenney 999daa9c4c (PDOC-8) Fix present rubocop offenses
Since we want to run rubocop in travis when pull requests are
submitted, fix a few pre-existing rubocop offenses.
2014-10-08 11:36:21 -07:00
Hailee Kenney d4059b6857 (PDOC-9) Update acceptance take task for Jenkins
In order to allow for multiple platforms on Jenkins, use the
platform environment variable in the rake task for acceptance tests
to determine which platform to run on.
2014-10-06 15:25:36 -07:00
Hailee Kenney aea5c9537f (PDOC-9) Switch to metadata.json for test module
Prior to this commit, the test module used in testing was using
a Modulefile rather than metadata.json. Switch to metadata.json
instead since Modulefile is deprecated and was causing a deprecation
warning during acceptance testing.
2014-10-06 10:21:58 -07:00
Hailee Kenney ee6997cd24 (PDOC-9) Add preliminary full system test
In order to help ensure that the strings module is not broken
during development, add a full system integration test which can
run at regular intervals to ensure that the module is working as
expected.

The test installs the string module as well as a test module which
contains the different types of puppet and ruby code that the strings
module can document. It then runs strings and ensures that the HTML
generated is correct.

Additionally, make some changes to the Gemfile to allow strings to
be run as a gem even if it isn't installed in the modulepath. Also
make a few changes to the unit tests to make them compatible with
the version of rspec required by Beaker.
2014-10-06 10:08:30 -07:00
Hailee Kenney 14571c098d (PDOC-3) Make references to YARD explicit
The specs were including YARD into the Kernel, which allowed shorter references to the Registry, but also obscured that
the Registry is part of YARD.
2014-09-30 14:02:31 -07:00
Hailee Kenney 94ff0a4445 (PDOC-3) Add method headers for new libraries
Add some comments for the new methods that have been introduced
to ensure that the code is readable and well documented.
2014-09-30 13:55:10 -07:00
Hailee Kenney 58fef9e8f6 (PDOC-3) Refactor face and remove modules action
Refactor the code in the strings face and extract much of the functionality
into a separate library in order to make the code more readable and
sustainable. Additionally, remove the `modules` action from the face
since it does not have a clear use case currently. However since the `server`
action depends on it, and it may be helpful to add other features in the future,
extract the functionality previously contained in `modules` into a helper
method.
2014-09-30 13:55:10 -07:00
Hailee Kenney 322dbfcc1e (PDOC-3) Use constants instead of strings in tests
Prior to this commit, several rspec tests were using `decribe "string"'
instead of `describe constant`. Update the tests to use the constant instead.
Additionally, rename the puppet function tests to reflect the renaming of the
handlers.
2014-09-30 13:52:31 -07:00
Hailee Kenney ebbc2936df (PDOC-3) Rename FutureParser and ParserFunctions
Prior to this commit, the handlers and code objects which dealt with
puppet functions were referred to as `FutureParserFunctions` and
`ParseFunctions`. This naming convention will not make very much
sense going forward when the future parser becomes the primary
parser. Therefor, rename `FutureParserFunctions` to `Puppet4xFunctions`
and `ParserFunctions` to `Puppet3xFunctions`.
2014-09-17 10:10:38 -07:00
Hailee Kenney dabcdf7f06 (PDOC-3) Add puppetlabs directory
In order to keep with conventions around directory structure, add
a puppetlabs directory and rename modules accordingly.
2014-09-16 09:07:59 -07:00
Hailee Kenney ec0e26e339 (PDOC-3) Rename face to strings instead of yardoc
Since we don't want the name of the tool to reflect the fact that
it is using yard internally (this is an implementation detail), rename
the face to `strings`. Now when one wishes to generate documentation,
`puppet strings` will be used rather than `puppet yardoc`.
2014-09-11 09:57:19 -07:00
Hailee Kenney 376ceb762c (PDOC-2) Split up handler specs
In order to make the code more readable, separate the tests into
different files for each handler. Additionally, extract the helper
methods into a separate module which may be included as needed.
2014-09-10 11:11:22 -07:00
Hailee Kenney c56d9fc27a (PDOC-2) Refactor tests for host class handler
Update the tests around the host class handler so that they test
several different examples as opposed to just one. Additionally,
refactor the tests so that they are more detailed when it comes to
checking if the Registry is in the correct state after code has been
parsed.
2014-09-09 14:57:31 -07:00
Hailee Kenney 2ebde0a21e (PDOC-2) Refactor tests for 3x function handler
Rework the tests around the 3x function handler. Make them more
verbose by having them them test against multiple examples and by making
the checking of the Registry more details.
2014-09-09 13:43:30 -07:00
Hailee Kenney 74a946fcfe (PDOC-2) Refactor tests for defined type handler
Like the 4x function handler tests, the tests around the defined
type handler were not very specific and didn't use multiple examples.
Update the tests so that they do more than just ensure that the right
objects were added to the Registry and cover a few different cases
instead of just one.
2014-09-09 11:38:41 -07:00
Hailee Kenney d5ffc4d8da (PDOC-2) Refactor tests for 4x function handler
Update the spec tests which cover the Puppet 4x function handler
to be more specific and cover different test cases. Prior to this commit,
they would simply check that the right objects had been added to the
Registry for one example. Now, they examine multiple examples and ensure that
the code objects not only exist but that the details about them are what we
would expect for each specific scenario.
2014-09-08 15:39:31 -07:00
Hailee Kenney 4c303a0258 (PDOC-2) Add tests around face and HTML generation
Add tests to ensure that the face (puppet yardoc) works from end to
end. In other words, ensure that when given a module, puppet yardoc can
successfully evaluate the .pp and .rb files present in the module and
produce the expected HTML.
2014-09-05 14:10:55 -07:00
Hailee Kenney 645f35ccfe (PDOC-5) Remove unneeded test case
Remove an unneeded test case. Since it would be caught even in a very
basic system, an automated test case is not needed.
2014-09-03 15:41:07 -07:00
Hailee Kenney b2267fcfc6 (PDOC-5) Test host classes and 3x functions
Add tests for the remaining two Puppet-specific handlers that were
not tested in the previous commit. Specifically, add tests for the
3.x function handler and the host class handler.
2014-09-03 15:41:00 -07:00
Hailee Kenney 8549bf7eff (PDOC-5) Test defined types and 4x functions
Begin to test the YARD handlers written for the puppet language.
Add basic tests for the defined type and puppet 4 function
handlers. In addition, make changes to the spec helper to make it
easier to work with YARD Registries for testing purposes.
2014-09-03 14:28:19 -07:00
Hailee Kenney 766fd57ebe (PDOC-5) Add spec testing for pops component
Prior to this commit there was no testing around the pops component.
Since most of the API in the pops component is private, there aren't
very many things to test, so add just a few test cases.

Additionally rename a previous spec file and make some changes to
the Gemfile.
2014-09-03 14:28:06 -07:00
Hailee Kenney 195374d2a7 (PDOC-5) Add spec testing for face component
Add spec tests for Puppet face component, mainly around error checking.
Due to the use of `puppet module list`, the behavior of the `modules`
and `server` actions are not very feasible to test via spec testing.

Additionally, make a few minor changes to the gem file, and make a
small change in `check_required_features` to reflect the fact that
this module will no longer support anything earlier than Ruby 1.9.
2014-09-03 14:27:48 -07:00
Charlie Sharpsteen a9408c792b Initial commit
Added skeleton from `puppet module generate` minus bits related to manifests.
2014-05-16 10:57:24 -07:00