summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/augeas
Commit message (Collapse)AuthorAgeFilesLines
* (#5606) Print Augeas' /augeas//error info to debug on save failureDominic Cleal2011-08-071-0/+18
| | | | | | When saving fails, the contents of /augeas//error (for put_failed) are printed to the debug log. Should help users track down the issue without needing to replicate it with augtool.
* (#8808) Fail Augeas resource when unable to save changesDominic Cleal2011-08-071-0/+14
| | | | | Raise a failure when Augeas changes cannot be saved (due to invalid layout of the tree, permissions etc). Fixes a regression.
* maint: Confine augeas specs to require the augeas featureNick Lewis2011-06-021-1/+1
|
* (#2728) Add diff output for changes made by Augeas providerMichael Knox2011-06-021-1/+106
| | | | | | | | | | | | | | | Utilising Augeas's SAVE_NEWFILE mode (similar to augtool -n) to determine the changes that will be made be made by Augeas. Output a unified diff to info handle non-default root, and multiple files correctly Adding tests for Augeas diff functionality Add test for non-default :root when diff'ing Ensure that multiple files are diffed if changed, not just one Signed-off-by: Josh Cooper <josh@puppetlabs.com> Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* maint: clean up the spec test headers in bulk.Daniel Pittman2011-04-131-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.
* maint: just require 'spec_helper', thanks rspec2Daniel Pittman2011-04-081-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>
* (#6494) Add setm command to Augeas providerDominic Cleal2011-02-251-0/+12
| | | | | | The Augeas setm command can set the value of multiple nodes in a single operation. Takes a base path, then a subnode path expression (relative to the base) and then the value itself.
* (#6494) Add mv command to Augeas providerDominic Cleal2011-02-251-0/+10
| | | | | Moves the first node to the position of the second, deleting it and its children if it already exists.
* (#6494) Add defnode command to Augeas providerDominic Cleal2011-02-251-1/+10
| | | | | Uses Augeas' defnode command which creates a variable pointing to a node, creating it with 'set' if it doesn't already exist.
* (#6494) Add defvar command to Augeas providerDominic Cleal2011-02-251-0/+23
| | | | | Uses Augeas' native defvar command to define variables for certain expressions that can then be referenced later with $variable.
* maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-061-1/+1
| | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* (#5211) Added patch and tests for checking the size of the arrary which is ↵Steve Nielson2010-12-021-0/+24
| | | | returned
* Code smell: Two space indentationMarkus Roberts2010-07-091-403/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Code smell: Avoid needless decorationsMarkus Roberts2010-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2 3 Examples: The code: ctx = OpenSSL::SSL::SSLContext.new() becomes: ctx = OpenSSL::SSL::SSLContext.new The code: skip() becomes: skip The code: path = tempfile() becomes: path = tempfile * Replaced 31 occurances of ^( *)end *#.* with \1end 3 Examples: The code: becomes: The code: end # Dir.foreach becomes: end The code: end # def becomes: end
* [#3994-part 3] rename spec tests from *_spec_spec to *_spec.rbMarkus Roberts2010-06-281-0/+0
| | | | Part 2 re-did the change on the spec files, which it shouldn't have.
* [#3994-part 2] rename integration tests to *_spec.rbMarkus Roberts2010-06-281-0/+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
* [#3994] rename the specs to have _spec.rb at the endMarkus Roberts2010-06-231-0/+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
* Unit tests for path changesMarc Fournier2010-02-171-0/+14
|
* Fixed the return types were valid, and removed the copy paste error with the ↵Bryan Kearney2010-02-171-3/+3
| | | | exception logic
* 2047: Add a not_include into matchBryan Kearney2010-02-011-0/+10
|
* * provider/augeas: strip whitespace and ignore blank linesDavid Lutterkort2009-06-121-0/+13
| | | | Signed-off-by: James Turnbull <james@lovedthanlost.net>
* #2332: Remove trailing slashes from path commands in the pluginBryan Kearney2009-06-091-0/+6
|
* * provider/augeas: minor spec test cleanupDavid Lutterkort2009-06-031-29/+30
| | | | | | - rename some tests to make their purpose clearer - add a test for nested predicates - remove trailing whitespace
* * provider/augeas: allow escaped whitespace and brackets in pathsDavid Lutterkort2009-06-031-0/+7
|
* * provider/augeas: match comparison uses '==' and '!=' againDavid Lutterkort2009-06-031-4/+4
| | | | | | Change the syntax for match in an onlyif back to using '==' for equality comparison instead of 'eq' (this was the behavior before 9a2642) and make operator for inequality '!='.
* Brought in lutters parse_commands patch and integrated it into the type.David Lutterkort2009-06-031-109/+105
| | | | | | | | | | | | | | | | | | | | | This includes reworking the get and match commands as well. This change introduces a few small changes. These are: 1) There can be no ' or " characters around path elements. 2) The context is now only prepended to relative paths. So, if a path is specified as /foo/bar the context will not be appended. It will only be appended if it is foo/bar 3) The syntax for array matching in the onlyif is now eq or noteq. It was == before. 4) The get and set commnands used to concatenate all items at the end of a string so "set path to some value" would be interpreted as "set" "path" "to some value". This is no longer supported. The caller must put ' or " around the "to some value" for it to work" Cherry-pick of 9a2642 from 0.24.x Conflicts: lib/puppet/provider/augeas/augeas.rb
* Fixing all tests that were apparently broken in the 0.24.x merge.Luke Kanies2009-04-021-0/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Added a force option to ensure the change is always applied, and call augeas ↵Bryan Kearney2009-03-041-91/+121
| | | | twice to reduce the chance that data is lost
* Backport the fix for #1835Bryan Kearney2009-03-041-0/+80
|
* First cut at the not running if augeas does not change any of the ↵Bryan Kearney2009-03-041-9/+16
| | | | underlieing files
* Bug 1948: Add logic and testing for the command parsing logicBryan Kearney2009-02-141-4/+13
|
* Bug #1948: Added patch by jab to support the correct ins syntax. Updated the ↵Bryan Kearney2009-02-131-12/+13
| | | | test cases as well
* Added unit tests for the augeas type and providerBryan Kearney2008-10-301-0/+238