summaryrefslogtreecommitdiffstats
path: root/spec/unit/application
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-11-03 19:58:38 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-11-03 19:59:37 -0700
commit9e2a0e41dfb253a19180aeea6b66f65ca8d63133 (patch)
treef102b396669c074b59eab5c2e59c5145b5bae6ab /spec/unit/application
parentb1ef091d0209a59ac747568f83416e992db93ea8 (diff)
parent85543a41978924a42490d0c3f1f5437c95b7c869 (diff)
Merge commit '85543a4'
This updates `master` to the pre-agile-iteration state.
Diffstat (limited to 'spec/unit/application')
-rwxr-xr-xspec/unit/application/apply_spec.rb11
-rw-r--r--spec/unit/application/master_spec.rb9
2 files changed, 9 insertions, 11 deletions
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb
index 85098f490..edb41b5c3 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 216c7dc90..e657445a4 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