[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:17:37 UTC 2011


The following commit has been merged in the experimental branch:
commit 7414ee7ebda1052f4c52f3e5565726f20de5a20b
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Thu Apr 21 12:03:13 2011 -0700

    maint: better disabling of Signal#trap in our tests.
    
    We tried to stub out the trap method on signal to stop our application level
    signal handlers getting in the way, but it kept not sticking.
    
    Now, instead, we just stub it out globally at the module level in our spec
    helper.  Less fun, but more effective.  Until rspec starts installing a signal
    handler, at least. :)

diff --git a/spec/monkey_patches/disable_signal_trap.rb b/spec/monkey_patches/disable_signal_trap.rb
new file mode 100644
index 0000000..5159626
--- /dev/null
+++ b/spec/monkey_patches/disable_signal_trap.rb
@@ -0,0 +1,5 @@
+module Signal
+  def trap(*args)
+    # The goggles, they do nothing!
+  end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index b04ec6f..01ffabc 100755
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -22,6 +22,7 @@ require 'lib/puppet_spec/files'
 require 'lib/puppet_spec/fixtures'
 require 'monkey_patches/alias_should_to_must'
 require 'monkey_patches/publicize_methods'
+require 'monkey_patches/disable_signal_trap'
 
 Pathname.glob("#{dir}/shared_behaviours/**/*.rb") do |behaviour|
   require behaviour.relative_path_from(Pathname.new(dir))
@@ -38,6 +39,10 @@ RSpec.configure do |config|
     # these globals are set by Application
     $puppet_application_mode = nil
     $puppet_application_name = nil
+
+    # REVISIT: I think this conceals other bad tests, but I don't have time to
+    # fully diagnose those right now.  When you read this, please come tell me
+    # I suck for letting this float. --daniel 2011-04-21
     Signal.stubs(:trap)
 
     # Set the confdir and vardir to gibberish so that tests

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list