]> gitweb.fluxo.info Git - puppet-dhcp.git/commitdiff
Speed up unit tests
authorMickaël Canévet <mickael.canevet@camptocamp.com>
Tue, 3 Feb 2015 13:14:25 +0000 (14:14 +0100)
committerMickaël Canévet <mickael.canevet@camptocamp.com>
Tue, 3 Feb 2015 13:14:25 +0000 (14:14 +0100)
Gemfile
spec/spec_helper.rb

diff --git a/Gemfile b/Gemfile
index a47fea7f52de433dc9c52a444d8d42a18ab59060..f1bdbfc873c336764421080768cc6e7fc49255db 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
 
 group :development, :unit_tests do
   gem 'rake',                                              :require => false
-  gem 'rspec-puppet',                                      :require => false
+  gem 'rspec-puppet',                                      :require => false, :git => 'https://github.com/camptocamp/rspec-puppet.git', :branch => 'rspec3'
   gem 'puppetlabs_spec_helper',                            :require => false
   gem 'puppet-lint', '~> 1.0.0',                           :require => false
   gem 'puppet-lint-unquoted_string-check',                 :require => false
index 1148f7f2a9dc80531f16459ef0c8b5ff98e54ba3..86cc740a76accfd0e27dc46d9c17ba6fc7bb412a 100644 (file)
@@ -7,24 +7,11 @@ RSpec.configure do |c|
   c.include PuppetlabsSpec::Files
 
   c.before :each do
-    # Ensure that we don't accidentally cache facts and environment
-    # between test cases.
-    Facter::Util::Loader.any_instance.stubs(:load_all)
-    Facter.clear
-    Facter.clear_messages
-
     # Store any environment variables away to be restored later
     @old_env = {}
     ENV.each_key {|k| @old_env[k] = ENV[k]}
 
-    if Gem::Version.new(`puppet --version`) >= Gem::Version.new('3.5')
-      Puppet.settings[:strict_variables]=true
-    end
-
-    if ENV['FUTURE_PARSER'] == 'yes'
-      c.parser='future'
-    end
-
+    Puppet.settings[:strict_variables]=true if Gem::Version.new(Puppet::PUPPETVERSION) >= Gem::Version.new('3.5')
     Puppet.features.stubs(:root?).returns(true)
   end