Commit graph

890 commits

Author SHA1 Message Date
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
f9f6e92dff Merge pull request #265 from apenney/fix-tests
Further fixes to tests for 14.04.
2014-06-03 14:53:04 -04:00
Ashley Penney
6010e9bd93 Further fixes to tests for 14.04. 2014-06-03 14:52:10 -04:00
Morgan Haskel
43df782406 Merge pull request #264 from apenney/fixes-for-tests
Fixes for PE3.3.
2014-06-03 11:13:35 -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
Ryan McKern
93c4151edf (MODULES-905) Narrow the confinement in bool2str
Previously, bool2str() accepted a broad array of boolean values and
bare strings, without any attempt to validate that the strings in any
way resembled "true" or "false" (or any of the other values bool2num()
accepts). This commit narrows the input confinement to TrueClass and
FalseClass, which means that bool2str() will only interpolate
strict boolean values now.
2014-05-15 15:01:14 -07:00
Ashley Penney
645de3cccb Merge pull request #257 from apenney/revert-before
Revert "Merge pull request #256 from stbenjam/2571-before"
2014-05-15 17:31:28 -04: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
Ashley Penney
8499ebdb7f Merge pull request #256 from stbenjam/2571-before
(PUP-2571) add 'before' functionality to file_line
2014-05-15 13:31:23 -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
Ryan McKern
42743614cb (MODULES-905) Add bool2str() and camelcase() for string manipulation
Python likes to have its constants Capitalized, and the capitalize
function only understands strings... so I shave a yak.

bool2str will convert a boolean to its equivalent string value,
and camelcase extends on uppercase & downcase to convert an underscore
delimited string into a camelcased string.
2014-05-13 15:46:40 -07:00
Ashley Penney
08b00d9229 Merge pull request #254 from apenney/421
Prepare a 4.2.1 release.
2014-05-09 19:15:17 -04:00
Ashley Penney
14c9155745 Prepare a 4.2.1 release. 2014-05-09 16:57:32 +02:00
Ashley Penney
04fa5a0cd9 Merge pull request #252 from hunner/release_4.2.0
Release - 4.2.0
2014-05-08 18:44:30 -04:00
Hunter Haugen
f3be3b625a Release - 4.2.0
Summary
========
This release adds many new functions and fixes, and continues to be backwards compatible with stdlib 3.x

Features
-------
- New `base64()` function
- New `deep_merge()` function
- New `delete_undef_values()` function
- New `delete_values()` function
- New `difference()` function
- New `intersection()` function
- New `is_bool()` function
- New `pick_default()` function
- New `union()` function
- New `validate_ipv4_address` function
- New `validate_ipv6_address` function
- Update `ensure_packages()` to take an option hash as a second parameter.
- Update `range()` to take an optional third argument for range step
- Update `validate_slength()` to take an optional third argument for minimum length
- Update `file_line` resource to take `after` and `multiple` attributes

Bugfixes
--------
- Correct `is_string`, `is_domain_name`, `is_array`, `is_float`, and `is_function_available` for parsing odd types such as bools and hashes.
- Allow facts.d facts to contain `=` in the value
- Fix `root_home` fact on darwin systems
- Fix `concat()` to work with a second non-array argument
- Fix `floor()` to work with integer strings
- Fix `is_integer()` to return true if passed integer strings
- Fix `is_numeric()` to return true if passed integer strings
- Fix `merge()` to work with empty strings
- Fix `pick()` to raise the correct error type
- Fix `uriescape()` to use the default URI.escape list
- Add/update unit & acceptance tests.
2014-05-08 15:20:35 -07:00
Ashley Penney
14d656dd41 Merge pull request #251 from hunner/fix_tests
Fix the stdlib functions that fail tests
2014-05-08 18:16:05 -04:00
Hunter Haugen
0804121719 Fix the stdlib functions that fail tests 2014-05-08 14:55:23 -07:00
Ashley Penney
e2297a1ea6 Merge pull request #250 from hunner/move_unit
Move unit tests to spec/functions
2014-05-08 13:58:53 -04: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
Ashley Penney
17a912ea0a Merge pull request #247 from hunner/more_tests
Adding more spec coverage
2014-05-07 18:03:57 -04: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
Hunter Haugen
176ff3abdc Merge pull request #248 from averi/master
Add the missing shebangs and fix the wrong ones
2014-05-07 09:53: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
e962b9553b Merge pull request #246 from hunner/update_build_csv
Update build_csv to understand contexts
2014-05-02 14:15:52 -07:00
Hunter Haugen
226cc7653c Update build_csv to understand contexts 2014-05-02 13:44:20 -07:00
Hunter Haugen
7443e8b805 Merge pull request #245 from hunner/fix_augeas
Fix the validate_augeas beaker tests
2014-05-02 12:57:04 -07:00
Hunter Haugen
af49ef4ca2 Fix the validate_augeas beaker tests 2014-05-02 12:56:22 -07:00
Ashley Penney
143a0078b0 Merge pull request #244 from hunner/add_tests
Add more specs
2014-05-01 18:56:29 -04: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
Hunter Haugen
1bdb213778 Merge pull request #242 from apenney/facts_d
Adjust the regular expression for facts.
2014-04-22 14:21:44 -07: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
Ashley Penney
6a5dee25a6 Merge pull request #239 from kylog/maint/remove-facter-versions-test
(maint) Remove facter versions test
2014-04-16 16:00:32 -04: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
746a4cc67a Merge pull request #236 from PierreRambaud/patch-1
Update README.markdown
2014-03-27 08:41:43 -04:00
GoT
d20cf40697 Update README.markdown
Add code block for validate_slength.
2014-03-27 11:56:17 +01:00