summaryrefslogtreecommitdiff
path: root/spec/integration/util/rdoc/parser_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-05-09(PUP-2214) Make util rdoc and related parser use :current_environmentHenrik Lindberg1-0/+7
2014-01-06(PUP-716) Change Puppet::FileSystem::File to module methodsHenrik Lindberg1-1/+1
This changes the API in a new implementation in a file called file_.rb The intent is that it should replace the implemntation in File, or perhaps directly in a Puppet::FileSystem class.
2013-11-08(#19447) Puppet::FileSystem::File.exist?Ethan J. Brown1-1/+1
- All previous File and FileTest calls to exist? or exists? go through the new FileSystem::File abstraction so that the implementation can later be swapped for a Windows specific one to support symlinks
2013-10-25(#22180) Recapture class comments under Ruby 2.0 RDocJosh Partlow1-9/+15
RDoc 2+ has an RDoc::ClassModule.add_comment(comment,location) method which is the preferred method of setting comments for a class. RDoc shipping with Ruby 1.9 seems to fall back to using the @comment, which is how rdoc1 handled this, but Ruby 2.0's rdoc seems to be stricter and requires use of add_comment. This patch overrides the add_comment method in our PuppetModule, PuppetClass, PuppetNode code objects with a version compatible with either rdoc1 or 2. It also tests for module level README comments being incorporated.
2013-10-24(#22180) Fix broken rdoc1 featuresJosh Partlow1-8/+65
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.
2013-10-23(#22180) Add integration test for puppet doc --mode rdocJosh Partlow1-35/+173
We were lacking any comprehensive testing of the interaction between puppet doc and rdoc. This integration test checks either the rdoc1 or rdoc2 output (depending on which version of rdoc is present on the system) for all of the basic module constructs we are documenting: modules, classes, defined types, nodes, and plugin facts, types and functions. It tests both site manifests and modules.
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-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-8/+10
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-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>
2010-07-09Code smell: Two space indentationMarkus Roberts1-42/+42
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 2] rename integration tests to *_spec.rbMarkus Roberts1-0/+59
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