summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-06-01 12:21:59 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-06-01 18:02:22 +0100
commitf3e79ddcd56a221c7799b35efde7e9803a5c7923 (patch)
tree730386688574c94169d47d37f79af77c2cda2f08 /spec/spec_helper.rb
parentb62dff0c6e09faf9bacfb02575e689ed09ee5e56 (diff)
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
Diffstat (limited to 'spec/spec_helper.rb')
-rwxr-xr-xspec/spec_helper.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index be392fd..f941c1c 100755
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -18,11 +18,17 @@ require 'puppet_spec/matchers'
require 'puppet_spec/database'
require 'monkey_patches/alias_should_to_must'
require 'mocha/api'
+#require 'puppetlabs_spec_helper/module_spec_helper'
+require 'puppetlabs_spec_helper_clone'
# hack to enable all the expect syntax (like allow_any_instance_of) in rspec-puppet examples
RSpec::Mocks::Syntax.enable_expect(RSpec::Puppet::ManifestMatchers)
RSpec.configure do |config|
+ config.module_path = File.join(File.dirname(File.expand_path(__FILE__)), 'fixtures', 'modules')
+ config.manifest_dir = File.join(File.dirname(File.expand_path(__FILE__)), 'fixtures', 'manifests')
+ config.environmentpath = spec_path = File.expand_path(File.join(Dir.pwd, 'spec'))
+
config.add_setting :puppet_future
#config.puppet_future = (ENV['FUTURE_PARSER'] == 'yes' or Puppet.version.to_f >= 4.0)
config.puppet_future = Puppet.version.to_f >= 4.0
@@ -35,8 +41,6 @@ RSpec.configure do |config|
Facter.clear
Facter.clear_messages
- Puppet[:parser] = 'future' if ENV['FUTURE_PARSER'] == 'yes'
-
RSpec::Mocks.setup
end
@@ -45,3 +49,7 @@ RSpec.configure do |config|
RSpec::Mocks.teardown
end
end
+
+# Helper class to test handling of arguments which are derived from string
+class AlsoString < String
+end