summaryrefslogtreecommitdiff
path: root/spec/unit/util/rdoc_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2013-10-24(#22180) Fix broken rdoc1 featuresJosh Partlow1-24/+18
There were a number of rdoc1 features (tracking of included, required modules, realized virtual resources, all resources when :document_all setting is true, and global variables) which had not been functioning due to the parser wrapping statements in Puppet::Parser::AST::BlockExpression instances now rather than Puppet::Parser::AST::Array instances. This is now fixed so that these areas are documented when using rdoc1. Only included classes is documented in rdoc2, however. Documenting the remaining elements would require writing a new renderer.
2012-11-01(Maint) Remove pending testAndrew Parker1-12/+0
This test is documented in bug #6634 and can be added back in when work is done to fix the issue.
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune1-1/+1
Without this patch Ruby 1.9 is still complaining loudly about trying to parse the spec files. The previous attempt to clean up this problem in edc3ddf works for Ruby 1.8 but not 1.9. I'd prefer to remove the shebang lines entirely, but doing so will cause encoding errors in Ruby 1.9. This patch strives for a happy middle ground of convincing Ruby it is actually working with Ruby while not confusing it to think it should exec() to rspec. This patch is the result of the following command run against the source tree: find spec -type f -print0 | \ xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
2012-08-13Merge branch '2.7.x' into 3.xJeff McCune1-2/+8
* 2.7.x: (#15940) Add test coverage for rdoc exclude option (#15940) Update puppet doc to ignore files and templates in modules (#7442) solaris: return "-1" for password_max_age when password aging is disabled (#7442) solaris: add tests for password_max_age attribute Conflicts: lib/puppet/util/rdoc.rb
2012-08-13(#15940) Add test coverage for rdoc exclude optionJeff McCune1-2/+8
Without this patch the addition of `<module>/templates/.*$` does not have test coverage. In addition, the existing test fails because the arguments have changed. This patch fixes both problems by updating the spec tests appropriately.
2012-07-24Make 3.x specs compatible with rspec 2.11Patrick Carlisle1-2/+3
2012-07-02(maint) Standardize on /usr/bin/env ruby -S rspecJeff McCune1-1/+1
Without this patch some spec files are using `ruby -S rspec` and others are using `rspec`. We should standardize on a single form of the interpreter used for spec files. `ruby -S rspec` is the best choice because it correctly informs editors such as Vim with Syntastic that the file is a Ruby file rather than an Rspec file.
2012-03-30Document and cleanly fail when unsupported RDoc is used.Daniel Pittman1-2/+7
Update the documentation and code to fail cleanly when a supported version of RDoc is not available. This does not yet tackle loading an RDoc version specific implementation of the process, only a clean failure when we can't cope. In future this should be replaced by some dynamic loading process based on the supported RDoc version, if we retain the tool. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-05-17(#7507) Add ability to filter Ruby 1.9 spec failuresMatt Robinson1-1/+1
By running: rspec spec --tag ~@fails_on_ruby_1.9.2 We can now just run the specs that pass under Ruby 1.9. Obviously in the long term we want to have all the specs passing, but until then we need notification when we regress. From now on new code will be required to pass under Ruby 1.9, and Jenkins will give us email notification if it doesn't or if we break something that was already working. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
2011-04-13Revert "(#6928) Removed --ignoreimport"Nick Lewis1-0/+12
This reverts commit 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07. Despite not needing --ignoreimport as an option anymore, it's still used internally and has to stay.
2011-04-13(#6928) Removed --ignoreimportNick Lewis1-12/+0
This was only used with --parseonly, which is gone. Paired-With: Jesse Wolfe
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman1-2/+1
We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment.
2011-04-08maint: just require 'spec_helper', thanks rspec2Daniel Pittman1-1/+1
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
2011-03-22maint: Change code for finding spec_helper to work with Ruby 1.9Matt Robinson1-1/+1
Running the specs under Ruby 1.9 didn't work using the lambda to recurse down directories to find the spec_helper. Standardizing the way to find spec_helper like the rest of specs seemed like the way to go. Here's the command line perl I used to make the change: perl -p -i -e "s/Dir.chdir.*lambda.*spec_helper.*$/require File.expand_path(File.dirname(__FILE__) + '\/..\/..\/spec_helper')/" `find spec -name "*_spec.rb"` Then I fixed the number of dots for files that weren't two levels from the spec dir and whose tests failed. Reviewed-by: Nick Lewis <nick@puppetlabs.com>
2011-03-08maint: Fix rdoc when documenting manifest filesMatt Robinson1-54/+16
The structure of the AST has changed from 2.6.x to master, so the code to generate documentation from the AST had to change. Generating documentation for resources other than classes, nodes and defines is still broken, see ticket #6634 Paired-with: Daniel Pittman <daniel@puppetlabs.com>
2010-11-10Fix #3808 - puppetdoc should use --force-update only if RDoc supports itBrice Figureau1-1/+9
This should allow to run puppetdoc on ruby 1.8.5. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2010-07-25Fix #4348 - Puppet doc single manifest brokenBrice Figureau1-0/+13
The refactoring of using environment instances instead of strings for initializing the parser, rdoc wasn't updated, thus was unable to initialize the parser. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2010-07-09Code smell: Two space indentationMarkus Roberts1-109/+109
Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
2010-06-28[#3994-part 3] rename spec tests from *_spec_spec to *_spec.rbMarkus Roberts1-0/+165
Part 2 re-did the change on the spec files, which it shouldn't have.
2010-06-28[#3994-part 2] rename integration tests to *_spec.rbMarkus Roberts1-165/+0
Some spec files like active_record.rb had names that would confuse the load path and get loaded instead of the intended implentation when the spec was run from the same directory as the file. Author: Matt Robinson <matt@puppetlabs.com> Date: Fri Jun 11 15:29:33 2010 -0700
2010-06-23[#3994] rename the specs to have _spec.rb at the endMarkus Roberts1-0/+165
Some spec files like active_record.rb had names that would confuse the load path and get loaded instead of the intended implentation when the spec was run from the same directory as the file. Author: Matt Robinson <matt@puppetlabs.com> Date: Fri Jun 11 15:29:33 2010 -0700