Commit graph

512 commits

Author SHA1 Message Date
Morgan Haskel
c69b75f88b Merge pull request #469 from hunner/fix_time
Fix time() on 1.8.7
2015-06-04 10:51:41 -07:00
Hunter Haugen
ad4ca4cc34 Fix time() on 1.8.7
The time() function takes an argument of a timezone, and always returns
time in epoch format. The epoch format is the number of seconds that
have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
seconds. This means that it is universally the same regardless of
timezones.

I don't know what the timezone argument is supposed to do, and it is not
documented. So lets just make 1.8.7 work like > 1.8.7
2015-06-04 09:40:52 -07:00
Eli Young
98c2f283b0 fqdn_rand_string: Add acceptance tests for custom charsets 2015-06-02 12:02:30 -07:00
Eli Young
84279e90ab fqdn_rotate: Add acceptance tests for custom seeds 2015-06-02 12:02:30 -07:00
Eli Young
b436216fe6 fqdn_rotate: Add tests for custom seeds 2015-06-01 17:03:42 -07:00
Eli Young
601f681787 fqdn_rotate: Don't use the value itself as part of the random seed
Previously, the random number generator was seeded with the array or
string to be rotated in addition to any values specifically provided for
seeding. This behavior is potentially insecure in that it allows an
attacker who can modify the source data to choose the post-shuffle
order.
2015-06-01 16:19:07 -07:00
David Schmitt
18d4c21418 Remove unused puppet_spec code
This is copied and changed code from an older version of puppet's internal
test setup code. It does not work with puppet4.
2015-06-01 18:02:22 +01:00
David Schmitt
f3e79ddcd5 Convert tests to use plain rspec-puppet
Tests in the new style produces the following documentation output:

abs
  should not eq nil
  should run abs() and raise an Puppet::ParseError
  should run abs(-34) and return 34
  should run abs("-34") and return 34
  should run abs(34) and return 34
  should run abs("34") and return 34
2015-06-01 18:02:22 +01:00
David Schmitt
b62dff0c6e spec_helper: implement an easy way for specs to confine to puppet version
Usage:

    describe 'puppet3 behaviour', :unless => RSpec.configuration.puppet_future do
    describe 'puppet4 behaviour', :if => RSpec.configuration.puppet_future do
2015-06-01 12:21:59 +01:00
David Schmitt
78bd9c8cbe Add the missing symlinks to get puppet 4 pickup the functions from the environmentpath 2015-06-01 12:21:59 +01:00
David Schmitt
65b56c711d Workaround the broken rspec-mocks support in rspec-puppet 2015-06-01 12:21:59 +01:00
David Schmitt
4a8c0a57f2 Merge pull request #463 from CENGN/fix/master/file_line_multiple_after
(MODULES-2071) Patch file_line provider to use multiple with after
2015-05-29 10:21:41 +01:00
Raymond Maika
72089f3d13 (MODULES-2071) Refactor file_line provider to contain logic to handle parameter multiple in function handle_create_with_after
Without this, file_line resource without the `match` parameter but with the `after` param will throw an error if there are multiple matches for the after expression. This patch creates the handling for the `multiple` parameter in handle_create_with_after. This allows you to add a line after the `after` expression if it appears at multiple points in a file.

Updated reference to `file_line` in the README to reflect that the multiple parameter can be set when using `after` and/or `match` as the matching regex.
2015-05-29 00:30:44 -04:00
David Schmitt
cf9f7a6b7e validate_integer, validate_numeric: explicitely reject hashes in arrays
Without this patch, Ruby 1.8's Hash#to_s behaviour causes [{1=>2}] to be
treated as "12" when validating values.
2015-05-27 20:05:05 +01:00
Hunter Haugen
732f7e8b35 Remove all the pops stuff
The rspec-puppet matchers don't allow to check the return types, but
this is a pretty rare thing to need to do anyway, so probably not worth
patching rspec-puppet
2015-05-12 15:03:27 -07:00
David Schmitt
f49eb6b8e2 range(): fix TypeError(can't convert nil into Integer) when using range syntax 2015-05-06 10:13:27 +01:00
David Schmitt
6a0a6153d5 spec_helper: Remove unneccesary stubbing
This only roots all Facter instances into memory, while something already
creates a new Facter instance each run.
2015-05-05 13:30:57 +01:00
David Schmitt
24680aceec spec_helper: use proper mocha import to avoid warning 2015-05-05 13:30:54 +01:00
David Schmitt
29f09e2181 spec_helper: set parser config if requested 2015-05-05 13:27:46 +01:00
David Schmitt
c0cf14e774 spec_helper_acceptance: fix FUTURE_PARSER usage
Use the more common "yes", instead of "true" to detect FUTURE_PARSER.
2015-05-05 13:27:46 +01:00
David Schmitt
a3016c45c5 specs: move function specs to where rspec-puppet expects them 2015-05-05 13:27:46 +01:00
David Schmitt
b664fec30f specs: loosen certain error expectations to make tests pass on future parser 2015-04-23 16:40:53 -07:00
Morgan Haskel
8a1d1e2f34 Merge pull request #314 from amateo/feature/loadyaml_check_file
Check if file exists before loading with loadyaml. If not, return nil
2015-04-16 10:48:10 -07:00
Angel L. Mateo
ac24e7acc7 test case for when the file does not exist 2015-04-13 09:27:03 +02:00
Bryan Jen
601e2e2574 Modules-2474: Only runs enhanced salts functional test on systems that support it. 2015-04-10 11:38:15 -07:00
Bryan Jen
cf7dbef1e8 Merge pull request #433 from cmurphy/fix_acceptance
Fix acceptance tests for #405
2015-04-10 10:05:02 -07:00
Colleen Murphy
65116dafd5 Fix acceptance tests for #405
This fixes the acceptance tests by:
 - Ensuring the fqdn_rand_string spec is passed undef as the second
   parameter so that the seed is not used as the charset
 - Ensuring the pw_hash spec is passed the key specifying the type of
   hash, rather than the value that will be used to generate the
   password
 - Expecting puppet to report nil instead of empty string for undef
   passwords
 - Removing the fqdn_rand_base64 test because there is no such function
2015-04-10 09:15:15 -07:00
David Schmitt
afec0ab981 Merge pull request #425 from jeffcoat/validate_augeas_spec
Fix off-by-one error in validate_augeas_spec.rb that was causing rspec failure

Even without the gem installed always, this is helpful to avoid errors should augeas be enabled/installed due to something else.
2015-04-10 13:28:48 +01:00
Morgan Haskel
5ee6e960f6 Merge pull request #431 from bmjen/file-line-refactor
File_line checks provided after param if no match is found
2015-04-09 16:47:34 -07:00
Colleen Murphy
e43f058296 Fix unsupported platforms variable name in tests
unsupported_platforms is not a valid identifier, and trying to use it
causes acceptance tests to error out before running any tests. The
correct identifier for the unsupported platforms constants is
UNSUPPORTED_PLATFORMS.
2015-04-09 15:53:16 -07:00
Travis Fields
0af0d7e539 Add spec tests and pulled in PR #427
Changed append line to open in 'w' mode and have to rewrite lines in order to append new line
2015-04-09 15:24:39 -07:00
Hunter Haugen
8fba5c058b Merge pull request #405 from elyscape/feature/fqdn_rand_strings
(MODULES-1715) Add FQDN-based random string generator
2015-04-09 10:45:38 -07:00
Eli Young
23be4020dd (MODULES-1737) Add pw_hash() function 2015-04-05 17:21:17 -07:00
Eli Young
a82266c256 (MODULES-1715) Add fqdn_rand string generators 2015-03-31 17:33:04 -07:00
Mark Jeffcoat
3fec51ac65 Fix off-by-one error in validate_augeas_spec.rb that was causing rspec failure. 2015-03-10 17:43:51 -05:00
Rod Montgomery
ee13438d2a If present, top-level domain must be alphabetic
See RFC 1123, Section 2.1
http://tools.ietf.org/html/rfc1123#section-2
2015-03-05 21:51:12 -06:00
TP Honey
bf8e5b0573 Merge pull request #422 from cyberious/assert_private
Assert private
2015-03-05 19:15:41 +00:00
Travis Fields
4a68b224c4 Add private function back and forward to assert_private with deprecation warning 2015-03-05 11:12:51 -08:00
Hunter Haugen
668b3c31b5 Merge pull request #369 from rfugina/dirname_typecheck
Dirname typecheck
2015-03-05 11:00:36 -08:00
Franz Pletz
56d815bcfc Rename private() to assert_private()
As mentioned in #270, private is a reserved keyword in the future parser
which is to be released with Puppet 4. As it stands, this function is
not useable with the future parser so it needs to renamed.

This is a breaking change.
2015-03-05 10:59:31 -08:00
Hunter Haugen
41965fd2c9 Merge pull request #375 from poikilotherm/feature/master/validate_integer_and_numeric
(MODULES-560) Add new functions validate_numeric() and validate_integer().
2015-03-05 10:57:43 -08:00
Stefan Goethals
0236cd51bc Add support for hashes in the prefix function
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2015-03-03 16:20:55 -08:00
Bryon Roché
41baef8502 URI.escape for the array case was incorrect.
The previous commit to uriescape() changed the implementation to use the ruby default escape list for URI.escape(), but did not change the call triggered when uriescape() was called on an array, triggering ruby errors.
2015-03-03 16:05:47 -08:00
Morgan Haskel
055083c117 Merge pull request #407 from adamcrews/ceiling_function
Add a ceiling function to complement the floor function.
2015-03-03 15:59:06 -08:00
Travis Fields
85e81f9bdf Loosen the restrictions of upcase and allow for recursion of the objects and only worry if the object responds to upcase 2015-03-02 10:45:43 -08:00
Travis Fields
7021b1f55c Add Hash to upcase 2015-02-25 11:39:27 -08:00
Sean Millichamp
1321d586a8 (MODULES-1771) Don't modify input to is_domain_name()
Fix is_domain_name() so it dup's its incoming argument
to avoid changing the original with a later chomp!
2015-02-14 10:49:26 -05:00
Eli Young
84f866ffaf (MODULES-1738) Don't modify global seed in fqdn_rotate()
As per puppetlabs/puppet@292233c, this leaves the global seed in a
deterministic state, which is bad. Puppet::Util.deterministic_rand()
exists to avoid running into this issue, but is only present starting in
Puppet 3.2.0.
2015-02-12 14:04:47 -08:00
Adam Crews
53b1802a92 Add a ceiling function to complement the floor function. 2015-02-01 22:46:16 -08:00
Hunter Haugen
bfb526899f Change all to each
The existence of this directory is behavior for each test, but will also
stop rspec 3 from complaining.
2015-01-13 17:21:28 -08:00
Hunter Haugen
7c8ae311ca (MODULES-1473) Deprecate type() function for new parser
The `type()` function will cease to work on the new parser because 'type'
is a reserved keyword. The `type3x()` function may be used to continue
similar functionality, but will be deprecated in favor of the built-in
typing system.

The `type_of()` function has been included to introspect types in the
new parser.
2015-01-07 16:40:06 -08:00
Travis Fields
8ec6f8dbfd MODULES-1606 add ability to pass array to delete for items to delete 2014-12-19 10:26:01 -08:00
Morgan Haskel
31a6d89410 Fix bad check in test 2014-12-18 16:20:02 -08:00
Hunter Haugen
1ae0a10707 Merge pull request #388 from mhaskel/merge_4.5.x_into_master
Merge 4.5.x into master
2014-12-18 15:55:33 -08:00
Peter Souter
cc8b147b5d (MODULES-1582) Specs for the new % placeholder
These specs are pretty much the same as the originals, but now check that the output has the correct replacement for file location
2014-12-18 23:08:33 +00:00
Morgan Haskel
696c89de99 Merge pull request #372 from poikilotherm/feature/master/validate_absolute_path_allow_arrays
Allow array of pathes in validate_absolute_path
2014-12-17 14:19:30 -08:00
Morgan Haskel
841b0df210 Merge pull request #368 from rfugina/basename
Basename implementation
2014-12-17 11:00:23 -08:00
Rob Fugina
2a3babc348 Added type checks for dirname(), and additional tests 2014-12-17 12:55:48 -06:00
Rob Fugina
ef3d42f7bb Added basename() based on Ruby's File.basename
Based on dirname code.  Includes RSpec tests and docs.
2014-12-17 12:39:40 -06:00
Hunter Haugen
c6c203fca8 Remove line match validation
The `match` attribute was validated to match `line`, except that in many
cases (even the example given in the docs) a user would want to match a
line entirely different from the new line.

See comments on the original commit
a06c0d8115
and ask
https://ask.puppetlabs.com/question/14366/file_line-resource-match-problems/
for further examples of confusion.
2014-12-16 15:05:31 -08:00
Oliver Bertuch
260c1f4b92 Add new functions validate_numeric() and validate_integer(). 2014-12-04 22:33:15 +01:00
Peter Souter
368c97f080 (MODULES-444) - Check for accepting > 2 args 2014-12-04 14:27:55 +00:00
Peter Souter
7a1c4a6d9e (MODULES-444) Change test to > 2 arguments
Also add extra test for just 1 argument
2014-12-04 14:27:38 +00:00
Peter Souter
5e49c50458 (MODULES-444) Acceptance for multiple arrays
Acceptance test to take multiple arrays for concatenation
2014-12-04 14:15:33 +00:00
Peter Souter
7c570f75a5 (MODULES-444) Acceptance test for primitives
`concat` should be able to concat arrays and primitives
2014-12-04 14:15:03 +00:00
Peter Souter
ed192a0464 (MODULES-444) Add specs for new behaviour
`concat` can now take multiple arguments
2014-12-04 14:12:55 +00:00
Oliver Bertuch
89995e4db0 Allow array of pathes in validate_absolute_path 2014-11-25 12:45:23 +01:00
Hunter Haugen
fb42396c75 Merge pull request #319 from Spredzy/member_array_in_array
(MODULES-1329) Allow member to look for array
2014-11-13 12:27:14 -08:00
Hunter Haugen
b6830f1ade Merge pull request #365 from dalen/range-integers
Make the range function work with integers
2014-11-13 10:16:21 -08:00
Yanis Guenane
c9f906f803 (MODULES-1329) Allow member function to look for array
Currently, the member function allows one to only find if a variable
is part of an array. Sometimes it is useful to find if an array is part
of a bigger array for validation purpose.
2014-11-12 14:40:34 -05:00
Erik Dalén
af0a2779cb Add range tests for numeric with step and mixed arguments 2014-11-12 16:52:36 +01:00
Erik Dalén
ce995e15d5 Make the range function work with integers
This is needed for the future parser which actually treats numbers as
numbers and strings as strings. With this patch you can use range(1,5)
instead of having to quote them like range('1','5').
2014-11-12 16:02:05 +01:00
Travis Fields
3584485902 Fix exclude windows test on ensure_package
Update to fix ensure_resource as well
2014-11-11 16:41:53 -08:00
Hunter Haugen
970141e36a Correct type() logic
It should NOT run if the future parser is enabled
2014-11-11 10:46:01 -08:00
Travis Fields
992ed8ffa8 Remove windows from ensure_package and ensure_resource testing 2014-11-10 16:34:05 -08:00
Morgan Haskel
850297b560 Merge pull request #354 from puppetlabs/4.3.x
4.3.x
2014-11-10 11:10:41 -08:00
Travis Fields
406e9dbda2 Merge pull request #343 from zacharyalexstern/fix_to_bytes
Added correct converstions for PB and EB.
2014-11-07 13:42:48 -08:00
Morgan Haskel
03f0ecd128 Merge pull request #350 from cyberious/modules1413
MODULES-1413 Add ability for member to take numeric objects
2014-11-04 15:29:25 -08:00
Travis Fields
f19aea5a75 MODULES-1413 Ability to for future parser to use member with FixNum types 2014-11-04 14:33:34 -08:00
Travis Fields
4bff0d2d61 Merge branch '4.3.x'
Conflicts:
	spec/acceptance/ensure_packages_spec.rb
	spec/acceptance/ensure_resource_spec.rb
2014-11-04 14:17:03 -08:00
Travis Fields
26e864f224 Fix the unless for test cases on ensure_package and ensure_resource
Conflicts:
	spec/acceptance/ensure_packages_spec.rb
	spec/acceptance/ensure_resource_spec.rb
2014-11-04 10:45:13 -08:00
Travis Fields
35c2dc7ca3 Merge branch '4.3.x' 2014-10-30 10:23:12 -07:00
Travis Fields
6c7da72c0f Fix validate_cmd, previous addition of SystemCallError only works for Puppet 3.7, previous version throw different exception. Wrapping in generic Exception catch all 2014-10-29 20:03:07 -07:00
Travis Fields
2b1cc82d24 Add windows test exclusion to ensure_resource 2014-10-28 16:43:15 -07:00
Travis Fields
9f68fd300f Fixed a mistake where we were trying to touch a host file using the default which was not relavent to the host we were modifying 2014-10-28 16:10:50 -07:00
Travis Fields
5497f83507 Fix logic issue with not including windows for testing ensure_packages as ruby and gem are not on the install path 2014-10-28 15:35:56 -07:00
Travis Fields
a6f3f781d1 Merge remote-tracking branch 'origin/4.3.x' back to master 2014-10-28 15:31:37 -07:00
Travis Fields
51f1d574d9 Fix testcases for Future Parser and resolve issue with values_at in assuming that it was dealing with a string 2014-10-28 15:27:24 -07:00
Zachary Alex Stern
9295d0d5ca Added correct converstions for PB and EB.
* We were converting Exabytes to bytes as Petabytes.
 * Updated tests to cover ever unit.
 * Added note that we're going by the old, inaccurate definitions of
   Kilobytes, Megabytes, etc, in that we treat them as powers of 2.
2014-10-28 13:14:06 -07:00
Mark Chappell
e2d7f3bb89 (MODULES-707) chomp() fails because generate() no longer returns a string
We need to use

  unless value.is_a?(String) || value.is_a?(Array)

rather than

  klass = value.class
  unless [String, Array].include?(klass)

because the klass version enforces type checking which is too strict, and does
not allow us to accept objects wich have extended String (or Array).

For example, generate() function now returns Puppet::Util::Execution::ProcessOutput
which is just a very simple extension of String.  While this in it's self was
not intentional (PUP-2306) it is not unreasonable to cope with objects which
extend Strings
2014-09-22 19:49:50 +02:00
Hunter Haugen
cf8d144caf Remove simplecov
simplecov 0.9 dropped ruby 1.8 support, and stdlib is one of the oddball
modules that uses it. So we could probably just remove it and be okay.

(cherry picked from commit a7c129b22d)
2014-09-16 12:01:24 -07:00
Morgan Haskel
2023692fc9 Update spec_helper for more consistency 2014-08-28 18:30:39 -04:00
Hunter Haugen
a7c129b22d Remove simplecov
simplecov 0.9 dropped ruby 1.8 support, and stdlib is one of the oddball
modules that uses it. So we could probably just remove it and be okay.
2014-08-05 11:28:18 -07:00
Hunter Haugen
2ba0e375e2 Merge branch '4.3.x' 2014-08-05 10:55:58 -07:00
Spencer Krum
a6ad0af08e Introduce test for array destruction
It was discovered that the concat array modifies the arrays passed to it
as an argument as a side effect. This test will ensure that doesn't
happen again.
2014-07-31 11:23:34 -07:00
Hunter Haugen
07462f2c36 AIX has no facter network support
These functions take advantage of IP fact information and AIX does not
appear to support dynamic interface detection in facter.
2014-07-08 13:45:36 -07:00
Hunter Haugen
ec607827ad Gotta single quote yer typewriter buttons 2014-06-26 13:55:57 -07:00
Hunter Haugen
1b893ff653 Need quotes for spaces in path 2014-06-26 13:17:07 -07:00
Hunter Haugen
b93f71f0ce has_ip_network doesn't work on windows either 2014-06-26 13:12:39 -07:00
Colleen Murphy
2fefd9c1e0 Sync files 2014-06-25 18:00:57 -07:00
Hunter Haugen
05b79dcabb Disable windows network stuff and quote path 2014-06-25 10:16:06 -07:00
Hunter Haugen
0cac9fd048 Not enough escape velocity 2014-06-24 15:03:58 -07:00
Hunter Haugen
ca35be6480 Fix pe facts and slashes 2014-06-24 11:37:34 -07:00
Travis Fields
eb507c9a54 Fixed fqdn,getparam and has_interface_with spec tests 2014-06-23 23:27:59 -07:00
Hunter Haugen
0427248cf0 Merge pull request #283 from cyberious/4.3.x
Add windows support and work around issue with SCP_TO on windows systems
2014-06-23 18:58:37 -07:00
Travis Fields
78f5141290 Removed platform check for facts.d mkdir 2014-06-23 18:30:42 -07:00
Travis Fields
0199e2396a Add windows support and work around issue with SCP_TO on windows systems 2014-06-23 16:59:46 -07:00
Hunter Haugen
f7b7c4a6ec Windows needs a tmpdir path 2014-06-23 15:13:29 -07:00
Travis Fields
d38ccfc9d2 Merge pull request #280 from hunner/win_aug
Augeas isn't present on windows
2014-06-23 13:51:33 -07:00
Hunter Haugen
280d808eb4 Augeas isn't present on windows 2014-06-23 13:50:24 -07:00
Hunter Haugen
4b7162896a OS X also has lo0 and can't manage user homedirs 2014-06-23 13:45:06 -07:00
Travis Fields
24a6fecc78 Add windows Nodesets and remove Beaker from Gemfile 2014-06-20 16:39:15 -07:00
Hunter Haugen
7eda161be8 Patch ensure_* tests 2014-06-20 10:41:43 -07:00
Hunter Haugen
4523bc50ca Merge branch 'master' into 4.3.x 2014-06-19 16:25:16 -07:00
Hunter Haugen
197e2d7e70 (FM-1587) Fix test issues on solaris 10
- ensure_packages fails because Error: Sun packages must specify a package source
- ensure_resource fails for the same reason
- get_module_path fails because the modulepath is different
- has_interface_with fails because the interface is lo0 not lo
2014-06-19 15:38:23 -07:00
Raphaël Pinson
2062f9734b Add private() function 2014-06-11 16:35:32 +02:00
Ashley Penney
6287a200af Convert specs to RSpec 2.99.0 syntax with Transpec
This conversion is done by Transpec 2.2.1 with the following command:
    transpec spec/functions

* 345 conversions
    from: obj.should
      to: expect(obj).to

* 122 conversions
    from: == expected
      to: eq(expected)

* 85 conversions
    from: lambda { }.should
      to: expect { }.to

* 22 conversions
    from: be_true
      to: be_truthy

* 16 conversions
    from: be_false
      to: be_falsey

* 11 conversions
    from: pending
      to: skip

* 9 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 5 conversions
    from: =~ [1, 2]
      to: match_array([1, 2])

* 2 conversions
    from: =~ /pattern/
      to: match(/pattern/)

* 2 conversions
    from: obj.should_not
      to: expect(obj).not_to

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2014-06-04 14:38:37 -04:00
Ashley Penney
d65d2354a7 Convert specs to RSpec 2.99.0 syntax with Transpec
This conversion is done by Transpec 2.2.1 with the following command:
    transpec spec/unit

* 53 conversions
    from: obj.should
      to: expect(obj).to

* 19 conversions
    from: == expected
      to: eq(expected)

* 5 conversions
    from: lambda { }.should
      to: expect { }.to

* 2 conversions
    from: be_true
      to: be_truthy

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2014-06-04 14:37:45 -04:00
Morgan Haskel
af71faa247 Merge pull request #265 from apenney/fix-tests
Further fixes to tests for 14.04.
2014-06-03 15:01:12 -04:00
Ashley Penney
6010e9bd93 Further fixes to tests for 14.04. 2014-06-03 14:52:10 -04:00
Morgan Haskel
a364605f3b Merge pull request #264 from apenney/fixes-for-tests
Fixes for PE3.3.
2014-06-03 11:15:20 -04:00
Ashley Penney
08f7553fb6 Fixes for PE3.3. 2014-06-03 11:11:08 -04:00
Ashley Penney
0cda858744 Merge pull request #258 from mckern/enhancement/master/camelcasedembools
(MODULES-905) Narrow the confinement in bool2str
2014-05-15 21:48:40 -04:00
Ryan McKern
557d38bdc6 (MODULES-905) Extend spec tests for bool2str
The extended spec tests validate that the common types of values
that could be passed to bool2str() are rejected.
2014-05-15 16:45:02 -07:00
Ashley Penney
c5b06f9bbc Revert "Merge pull request #256 from stbenjam/2571-before"
This reverts commit 8499ebdb7f, reversing
changes made to 08b00d9229.
2014-05-15 17:28:59 -04:00
Ashley Penney
430d821ad3 Merge pull request #255 from mckern/enhancement/master/camelcasedembools
(MODULES-905) Add bool2str() and camelcase() for string manipulation
2014-05-15 17:03:18 -04:00
Stephen Benjamin
6eaa592cd8 (PUP-2571) add 'before' functionality to file_line
file_line supports adding lines after a match, but there are use cases when
having "before" would be useful. For example, in Debian-based OS's, the last
line of /etc/rc.local is "exit 0" it's an incredible pain to deal with
that scenario today.

This commit adds a 'before' parameter to the file_line type, and implements
it for the ruby provider.
2014-05-14 20:33:57 +02:00
Ryan McKern
0761fcf043 (maint) Add bool2str & camelcase spec tests 2014-05-13 15:46:50 -07:00
Ashley Penney
14c9155745 Prepare a 4.2.1 release. 2014-05-09 16:57:32 +02:00
Hunter Haugen
0804121719 Fix the stdlib functions that fail tests 2014-05-08 14:55:23 -07:00
Hunter Haugen
96e43e69d8 Move unit tests to spec/functions
rspec-puppet matchers are defined for tests which exist in
spec/functions, but the function unit tests lived in
spec/unit/puppet/parser/functions. This moves them to the correct place
for using rspec-puppet
2014-05-08 10:47:24 -07:00
Hunter Haugen
c66a2e4f49 Add mode +x to spec .rb files 2014-05-07 15:00:30 -07:00
Hunter Haugen
78982c9238 Move the 4 misplaced tests 2014-05-07 15:00:30 -07:00
Hunter Haugen
890ef5c471 Adding more spec coverage 2014-05-07 15:00:30 -07:00
Andrea Veri
09f892023c Add the missing shebangs and fix the wrong ones for rpmlint to stop complaining loudly 2014-05-07 11:49:25 +02:00
Hunter Haugen
226cc7653c Update build_csv to understand contexts 2014-05-02 13:44:20 -07:00
Hunter Haugen
af49ef4ca2 Fix the validate_augeas beaker tests 2014-05-02 12:56:22 -07:00
Hunter Haugen
80590a9bfe Add more specs 2014-05-01 14:07:54 -07:00
Ashley Penney
f8bfe46bbf Merge pull request #243 from hunner/add_beaker
Add beaker tests for functions.
2014-04-28 14:55:29 -04:00
Ashley Penney
0b59dfe642 Merge pull request #222 from mfoo/fix/master/concat-primitives
Allow concat to take non-array second parameters
2014-04-24 13:41:42 -04:00
Ashley Penney
f42fc4bfd8 Merge pull request #238 from Spredzy/add_default_ensure_packages
(MODULES-603) Add defaults arguments to ensure_packages()
2014-04-24 13:38:07 -04:00
Ashley Penney
68acb59bf7 Adjust the regular expression for facts.
Previously this was incorrectly handling facts that were of the form
foo=1+1=2 due to the ='s in the actual fact contents.  Fix this and
add tests to try and prevent regressions.
2014-04-22 23:15:16 +02:00
Kylo Ginsberg
b691be7ea9 (maint) Remove facter versions test
This test attempts to emulate various versions of facter, but is
still dependent on the version of facter it is running against. The
immediate symptom was that the test breaks with facter 2.0.1 because
it adds another external facts search directory.

I tried a couple ways to stub this but allowing it to pretend
to run against one set of facters, while actually running against
one real facter (which might itself be one of several versions)
eluded me.

So this patch just removes the test.
2014-04-16 12:30:24 -07:00
Hunter Haugen
90222959b1 Adding more tests 2014-04-09 14:35:34 -07:00
Hunter Haugen
8a269c6722 Add build_csv 2014-04-08 16:38:33 -07:00
Hunter Haugen
f8f147e794 Add success/fail groups 2014-04-08 15:04:55 -07:00
Hunter Haugen
fcbc4b59a6 First set of tests 2014-04-03 16:58:12 -07:00
Ashley Penney
afb78e2b25 Add some acceptance tests for functions. 2014-04-03 16:58:12 -07:00
Yanis Guenane
d9b5e912bb (MODULES-603) Add defaults arguments to ensure_packages()
Without this patch one can not specify package resource specific
parameters. All the ensure_packages() function does it makes sure
the named packages are installed. This patch allows one to pass
default as a second argument and allow greater flexibility on
packages installations.

Use case like the following are now possible :
  * ensure_packages(['r10k', 'serverspec'], {'provider' => 'gem'})
  * ensure_packages(['ntp'], {'require' => 'Exec[foobar]'})
2014-03-30 18:47:36 -04:00
Ashley Penney
9a3107fed1 Add beaker framework.
This prepares the module for beaker acceptance tests.
2014-03-12 18:22:23 +00:00