diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-08-17 12:02:05 -0700 |
|---|---|---|
| committer | Jesse Wolfe <jes5199@gmail.com> | 2010-08-17 12:25:37 -0700 |
| commit | 16f701edd89a320ad73b5468d883dfb017fe6e96 (patch) | |
| tree | 0063bdd34139f0ba09be638f8eabf4bf0e596008 /spec/unit/application | |
| parent | 3c090de39897d85a5d5be20254efcddea14ad8ad (diff) | |
| parent | 4da88fb4cd57871f16649d50572240ac3f7420f0 (diff) | |
| download | puppet-16f701edd89a320ad73b5468d883dfb017fe6e96.tar.gz puppet-16f701edd89a320ad73b5468d883dfb017fe6e96.tar.xz puppet-16f701edd89a320ad73b5468d883dfb017fe6e96.zip | |
Merge remote branch 'paul/4472-4483-4496-4521-4522'
a.k.a. "make_taller_trees"
Diffstat (limited to 'spec/unit/application')
| -rwxr-xr-x | spec/unit/application/apply_spec.rb | 11 | ||||
| -rw-r--r-- | spec/unit/application/master_spec.rb | 9 |
2 files changed, 9 insertions, 11 deletions
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb index 0b00d1a2e..a79ddbad3 100755 --- a/spec/unit/application/apply_spec.rb +++ b/spec/unit/application/apply_spec.rb @@ -142,17 +142,16 @@ describe Puppet::Application::Apply do describe "the parseonly command" do before :each do - Puppet.stubs(:[]).with(:environment) + @environment = Puppet::Node::Environment.new("env") + Puppet.stubs(:[]).with(:environment).returns(@environment) Puppet.stubs(:[]).with(:manifest).returns("site.pp") Puppet.stubs(:err) @apply.stubs(:exit) @apply.options.stubs(:[]).with(:code).returns "some code" - @collection = stub_everything - Puppet::Resource::TypeCollection.stubs(:new).returns(@collection) end - it "should use a Puppet Resource Type Collection to parse the file" do - @collection.expects(:perform_initial_import) + it "should use the environment to parse the file" do + @environment.stubs(:perform_initial_import) @apply.parseonly end @@ -162,7 +161,7 @@ describe Puppet::Application::Apply do end it "should exit with exit code 1 if error" do - @collection.stubs(:perform_initial_import).raises(Puppet::ParseError) + @environment.stubs(:perform_initial_import).raises(Puppet::ParseError) @apply.expects(:exit).with(1) @apply.parseonly end diff --git a/spec/unit/application/master_spec.rb b/spec/unit/application/master_spec.rb index 0baa8229b..d23021317 100644 --- a/spec/unit/application/master_spec.rb +++ b/spec/unit/application/master_spec.rb @@ -257,16 +257,15 @@ describe Puppet::Application::Master do describe "the parseonly command" do before :each do - Puppet.stubs(:[]).with(:environment) + @environment = Puppet::Node::Environment.new("env") + Puppet.stubs(:[]).with(:environment).returns(@environment) Puppet.stubs(:[]).with(:manifest).returns("site.pp") Puppet.stubs(:err) @master.stubs(:exit) - @collection = stub_everything - Puppet::Resource::TypeCollection.stubs(:new).returns(@collection) end it "should use a Puppet Resource Type Collection to parse the file" do - @collection.expects(:perform_initial_import) + @environment.expects(:perform_initial_import) @master.parseonly end @@ -276,7 +275,7 @@ describe Puppet::Application::Master do end it "should exit with exit code 1 if error" do - @collection.stubs(:perform_initial_import).raises(Puppet::ParseError) + @environment.stubs(:perform_initial_import).raises(Puppet::ParseError) @master.expects(:exit).with(1) @master.parseonly end |
