summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
AgeCommit message (Collapse)Author
2016-04-07(maint) Update to current modulesync_configs [953280c]David Schmitt
This removes much of the assorted cruft that accumulated in the unmanaged files and moves the remaining necessary parts to spec_helper_local.
2015-06-01Remove unused puppet_spec codeDavid Schmitt
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-01Convert tests to use plain rspec-puppetDavid Schmitt
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-01spec_helper: implement an easy way for specs to confine to puppet versionDavid Schmitt
Usage: describe 'puppet3 behaviour', :unless => RSpec.configuration.puppet_future do describe 'puppet4 behaviour', :if => RSpec.configuration.puppet_future do
2015-06-01Workaround the broken rspec-mocks support in rspec-puppetDavid Schmitt
2015-05-05spec_helper: Remove unneccesary stubbingDavid Schmitt
This only roots all Facter instances into memory, while something already creates a new Facter instance each run.
2015-05-05spec_helper: use proper mocha import to avoid warningDavid Schmitt
2015-05-05spec_helper: set parser config if requestedDavid Schmitt
2014-08-05Remove simplecovHunter Haugen
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-05-07Add mode +x to spec .rb filesHunter Haugen
2014-05-07Add the missing shebangs and fix the wrong ones for rpmlint to stop ↵Andrea Veri
complaining loudly
2014-03-08Numerous changes to update testing gems.Ashley Penney
This work updates a number of Gems to the latest versions (rspec, rspec-puppet), and updates and tweaks a bunch of tests to work with the updated gems.
2012-10-25Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""Jeff McCune
This reverts commit d6d23b495cda0e154b4e73982acc43e586564c0e. Why? Because this change set should actually be in master and our merge-up process reverted the change set in master when I reverted from 2.4.x. This patch reverts the revert, restoring the original change set.
2012-10-25Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"Jeff McCune
This reverts commit 74e6411157b8df1af9a24c17971e3236f3096529, reversing changes made to 417d219aa6e42f2a16af42c98aa063fc1d9d2ecd. Here's why: Actually... I just screwed this up. I merged this new fact into 2.4.x but it's not fixing any bug. It's adding a new fact, so this should go into master and we should release 2.5 since this is new, backwards-compatible functionality.
2012-10-24(maint) Clear all facts before each exampleJeff McCune
Without this patch example groups must explicitly call `Facter.clear` to clear any cached values between examples. This is a problem because this behavior is not the concern of the example groups, the behavior is the concern of the spec_helper or whatever facility we have in place to initialize the system for testing. This patch fixes the problem by duplicating the logic in the Facter spec_helper to ensure facts are cleared out before each example. This patch requires the example groups to explicitly load the facts they require if the fact name does not match the filename.
2012-07-19(Maint) use PuppetlabsSpec::PuppetSeams.parser_scopeJeff McCune
Without this patch all of the spec tests for parser functions in stdlib would instantiate their own scope instances. This is a problem because the standard library is tightly coupled with the internal behavior of Puppet. Tight coupling like this creates failures when we change the internal behavior of Puppet. This is exactly what happened recently when we changed the method signature for the initializer of Puppet::Parser::Scope instances. This patch fixes the problem by creating scope instances using the puppet labs spec helper. The specific method that provides scope instances in Puppet-version-independent way is something like this: let(:scope) { PuppetlabsSpec::PuppetSeams.parser_scope } This patch simply implements this across the board.
2012-05-11Fix spec tests using the new spec_helperJeff McCune
This patch back ports the file from the master branch. The spec tests fail without this patch applied. This should make it easier to setup Puppet settings using the puppet_spec_helper project.
2012-04-04Revert "Merge remote-tracking branch ↵Jeff McCune
'eshamow/tickets/bug/13595_restrict_initialize_everything_for_tests' into 2.2.x" This reverts commit 40da421c0480f940638d0db9aabf180500d6ae5c, reversing changes made to 69465b0f3e0c0c5284812bfa76ab8d3c254d10a9.
2012-04-03(#13595) initialize_everything_for_tests couples modules Puppet verEric Shamow
Replace regex used in spec_helper.rb to disallow both Puppet 2.6 and any 2.7 prior to 13.
2012-03-29(#13439) Fix MRI 1.9 issue with spec_helperJeff McCune
When using MRI 1.9.x the stdlib spec helper does not invoke because Puppet.settings.private_methods returns symbols instead of strings. This is a problem because we need to set default configuration settings like Puppet[:vardir] when using the compiler. This patch fixes the issue by simply checking the Puppet version. This seems a better choice than rescuing NoMethodError since the method might be renamed or removed in the future.
2012-03-29(#13439) Fix test failures with Puppet 2.6.xJeff McCune
Without this patch the spec_helper sends a message named initialize_everything_for_tests to Puppet.settings. This is a problem because Puppet 2.6.x does not have this method, only Puppet 2.7.x and Puppet master have this method at this time and we're getting false positive test failures. This patch fixes the problem by looking before we leap. We test if the private method exists before calling it. This works with Ruby 1.8.5 and onwards and Puppet 2.6, 2.7 and master. This should fix all of the failures I've caused in Jenkins today.
2012-03-29(#13439) refactor spec helper for compatibility with both puppet 2.7 andcprice
master
2011-10-10(Maint) Make rspec tests work with Puppet 2.6.4Jeff McCune
The behavior without this patch applied is that the rspec tests do not function with Puppet 2.6.4. This patch back-ports some fixes introduced in Puppet 2.7.x to the spec_helper to make the tests work as expected on Puppet 2.6.4. The specific patches back ported from Puppet are: * 2ae88067 (Puppet::Util::ExecutionStub.reset) * cf183534 (Switched spec tests to use a class rather than Array as the log destination.)
2011-10-03(#9859) Add root_home fact and testsJeff McCune
Without this patch applied, the stdlib module does not provide a root_home fact. This fact is necessary to easily determine the root account home directory on platforms Puppet is supported on. The major variations this fact address are: --- solaris: / linux: /root macosx: /var/root Spec tests using rspec have been provided as well to cover these three general cases. Windows tests are marked as pending.
2011-08-05(#8797) Merge puppetlabs-functions into puppetlabs-stdlibKen Barber
It was decided that maintaining puppetlabs-functions and puppetlabs-stdlib was duplication as both are trying to achieve the same goal. This patch provides a merge of the puppetlabs-functions into the puppetlabs-stdlib repository, with history preservation. The following conflicts were found and resolved: * LICENSE file from functions was used as it aligns with ASL usage instructions and contains relevant copyright information: http://www.apache.org/licenses/LICENSE-2.0.html * Used spec_helper.rb from functions - this is what Puppet core uses and doesn't break tests. * Merged .gitignore and spec.opts options.
2011-06-29Copied function test scaffolding from puppet.Ken Barber
2011-05-24Initial commitJeff McCune