Browse files

- skip rpm tests and warn if 'rpmbuild' is not found.

- add an 'rspec' specific log channel
  • Loading branch information...
1 parent 233adf7 commit d2ca3db26d388ca43e5ece8c6b56079c823c1cae @jordansissel committed Mar 9, 2012
Showing with 18 additions and 4 deletions.
  1. +6 −1 spec/fpm/package/rpm_spec.rb
  2. +12 −3 spec/spec_setup.rb
View
7 spec/fpm/package/rpm_spec.rb
@@ -4,7 +4,12 @@
require "fpm/package/dir" # local
require "arr-pm/file" # gem 'arr-pm'
-describe FPM::Package::RPM do
+if !program_in_path?("rpmbuild")
+ Cabin::Channel.get("rspec") \
+ .warn("Skipping RPM tests because I can't find 'rpmbuild' in your PATH")
+end
+
+describe FPM::Package::RPM, :if => program_in_path?("rpmbuild") do
subject { FPM::Package::RPM.new }
describe "#output" do
View
15 spec/spec_setup.rb
@@ -1,16 +1,25 @@
require "rubygems" # for ruby 1.8
-require "insist" # gem 'insist'
-require "rush" # gem 'rush'
+require "insist" # gem "insist"
+require "rush" # gem "rush"
+require "cabin" # gem "cabin"
require "tmpdir" # stdlib
require "tempfile" # stdlib
require "fileutils" # stdlib
-# put 'lib' in RUBYLIB
+# put "lib" in RUBYLIB
$: << File.join(File.dirname(File.dirname(__FILE__)), "lib")
+# for method "program_in_path?" etc
+require "fpm/util"
+include FPM::Util
+
# Enable debug logs if requested.
if $DEBUG or ENV["DEBUG"]
Cabin::Channel.get.level = :debug
Cabin::Channel.get.subscribe(STDOUT)
end
+spec_logger = Cabin::Channel.get("rspec")
+spec_logger.subscribe(STDOUT)
+spec_logger.level = :warn
+

0 comments on commit d2ca3db

Please sign in to comment.