summaryrefslogtreecommitdiffstats
path: root/spec/unit/application.rb
diff options
context:
space:
mode:
authorDavid Schmitt <david@dasz.at>2010-05-17 16:11:20 +0200
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitf054d5b6abe2de3810203b13c8f263d9a23f0d50 (patch)
tree19a76a255946261c40a2d9b64b9096d73dd83d9c /spec/unit/application.rb
parent54c453853ddb1648af14b42dca6f827c5cb8e007 (diff)
downloadpuppet-f054d5b6abe2de3810203b13c8f263d9a23f0d50.tar.gz
puppet-f054d5b6abe2de3810203b13c8f263d9a23f0d50.tar.xz
puppet-f054d5b6abe2de3810203b13c8f263d9a23f0d50.zip
Make specs work on win32
lib/: * Fix Puppet::Parser::Files * Fix Puppet::Util::Settings spec/: * unit/application/kick.rb: only run on posix * unit/application.rb * unit/parser/compiler.rb * unit/parser/files.rb * unit/resource.rb * unit/resource/catalog.rb * unit/resource/type_collection.rb * unit/transaction.rb * unit/type/tidy.rb * unit/util/settings.rb * unit/util/settings/file_setting.rb * unit/application.rb
Diffstat (limited to 'spec/unit/application.rb')
-rwxr-xr-xspec/unit/application.rb27
1 files changed, 17 insertions, 10 deletions
diff --git a/spec/unit/application.rb b/spec/unit/application.rb
index daaed0c9a..9dc655d14 100755
--- a/spec/unit/application.rb
+++ b/spec/unit/application.rb
@@ -10,6 +10,9 @@ describe Puppet::Application do
before do
@app = Class.new(Puppet::Application).new
+
+ # avoid actually trying to parse any settings
+ Puppet.settings.stubs(:parse)
end
it "should have a run entry-point" do
@@ -145,17 +148,21 @@ describe Puppet::Application do
end
end
- it 'should signal process with HUP after block if restart requested during block execution' do
- Puppet::Application.run_status = nil
- target = mock 'target'
- target.expects(:some_method).once
- old_handler = trap('HUP') { target.some_method }
- begin
- Puppet::Application.controlled_run do
- Puppet::Application.run_status = :restart_requested
+ describe 'on POSIX systems' do
+ confine "HUP works only on POSIX systems" => Puppet.features.posix?
+
+ it 'should signal process with HUP after block if restart requested during block execution' do
+ Puppet::Application.run_status = nil
+ target = mock 'target'
+ target.expects(:some_method).once
+ old_handler = trap('HUP') { target.some_method }
+ begin
+ Puppet::Application.controlled_run do
+ Puppet::Application.run_status = :restart_requested
+ end
+ ensure
+ trap('HUP', old_handler)
end
- ensure
- trap('HUP', old_handler)
end
end