This works around the interaction of Debian packaged librspec-ruby and gems.
Under Debian the library is available, but the gem support fails; this ignores
the gem failure and carries on anyway.

Signed-off-by: Daniel Pittman <[email protected]>

---
 spec/spec_helper.rb |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 539ae20..52a896c 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -21,7 +21,15 @@ end
 require 'puppettest'
 require 'puppettest/runnable_test'
 require 'mocha'
-gem 'rspec', '>=1.2.9'
+
+begin
+  gem 'rspec', '>=1.2.9'
+rescue Gem::LoadError => error
+  raise unless error.message =~ %r{Could not find RubyGem}
+  raise unless File.exists?('/etc/debian_version')
+  raise unless require 'spec'
+  print "ignoring rspec gem load error, thanks Debian\n"
+end
 require 'spec/autorun'
 
 # So everyone else doesn't have to include this base constant.
-- 
tg: (1f3070c..) t/debian-rspec-gem-fix (depends on: master)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to