From 6ed00515e8614233160d74b1c32b75fab27ac722 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Fri, 8 Apr 2011 16:06:57 -0700 Subject: maint: just require 'spec_helper', thanks rspec2 rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen --- spec/unit/node/environment_spec.rb | 2 +- spec/unit/node/facts_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/unit/node') diff --git a/spec/unit/node/environment_spec.rb b/spec/unit/node/environment_spec.rb index d34bdb000..b8e7f6890 100755 --- a/spec/unit/node/environment_spec.rb +++ b/spec/unit/node/environment_spec.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') +require 'spec_helper' require 'puppet/node/environment' require 'puppet/util/execution' diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb index 797009ae4..b548e4d99 100755 --- a/spec/unit/node/facts_spec.rb +++ b/spec/unit/node/facts_spec.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') +require 'spec_helper' require 'puppet/node/facts' -- cgit From db11770718c61f9ee3d5fcd703c5c0c7c05227ca Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Wed, 13 Apr 2011 00:35:11 -0700 Subject: maint: clean up the spec test headers in bulk. We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment. --- spec/unit/node/environment_spec.rb | 3 +-- spec/unit/node/facts_spec.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'spec/unit/node') diff --git a/spec/unit/node/environment_spec.rb b/spec/unit/node/environment_spec.rb index b8e7f6890..d1badfa3a 100755 --- a/spec/unit/node/environment_spec.rb +++ b/spec/unit/node/environment_spec.rb @@ -1,5 +1,4 @@ -#!/usr/bin/env ruby - +#!/usr/bin/env rspec require 'spec_helper' require 'puppet/node/environment' diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb index b548e4d99..a130ae3f8 100755 --- a/spec/unit/node/facts_spec.rb +++ b/spec/unit/node/facts_spec.rb @@ -1,5 +1,4 @@ -#!/usr/bin/env ruby - +#!/usr/bin/env rspec require 'spec_helper' require 'puppet/node/facts' -- cgit From 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07 Mon Sep 17 00:00:00 2001 From: Nick Lewis Date: Wed, 13 Apr 2011 14:38:23 -0700 Subject: (#6928) Removed --ignoreimport This was only used with --parseonly, which is gone. Paired-With: Jesse Wolfe --- spec/unit/node/environment_spec.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'spec/unit/node') diff --git a/spec/unit/node/environment_spec.rb b/spec/unit/node/environment_spec.rb index d1badfa3a..b5efbd480 100755 --- a/spec/unit/node/environment_spec.rb +++ b/spec/unit/node/environment_spec.rb @@ -315,14 +315,6 @@ describe Puppet::Node::Environment do lambda { @env.instance_eval { perform_initial_import } }.should raise_error(Puppet::Error) end - it "should not do anything if the ignore_import settings is set" do - Puppet.settings[:ignoreimport] = true - @parser.expects(:string=).never - @parser.expects(:file=).never - @parser.expects(:parse).never - @env.instance_eval { perform_initial_import } - end - it "should mark the type collection as needing a reparse when there is an error parsing" do @parser.expects(:parse).raises Puppet::ParseError.new("Syntax error at ...") @env.stubs(:known_resource_types).returns Puppet::Resource::TypeCollection.new(@env) -- cgit From 5915814c47649bb4b957b4be4fcee5919b859451 Mon Sep 17 00:00:00 2001 From: Nick Lewis Date: Wed, 13 Apr 2011 16:57:11 -0700 Subject: Revert "(#6928) Removed --ignoreimport" This reverts commit 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07. Despite not needing --ignoreimport as an option anymore, it's still used internally and has to stay. --- spec/unit/node/environment_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/unit/node') diff --git a/spec/unit/node/environment_spec.rb b/spec/unit/node/environment_spec.rb index b5efbd480..d1badfa3a 100755 --- a/spec/unit/node/environment_spec.rb +++ b/spec/unit/node/environment_spec.rb @@ -315,6 +315,14 @@ describe Puppet::Node::Environment do lambda { @env.instance_eval { perform_initial_import } }.should raise_error(Puppet::Error) end + it "should not do anything if the ignore_import settings is set" do + Puppet.settings[:ignoreimport] = true + @parser.expects(:string=).never + @parser.expects(:file=).never + @parser.expects(:parse).never + @env.instance_eval { perform_initial_import } + end + it "should mark the type collection as needing a reparse when there is an error parsing" do @parser.expects(:parse).raises Puppet::ParseError.new("Syntax error at ...") @env.stubs(:known_resource_types).returns Puppet::Resource::TypeCollection.new(@env) -- cgit