Skip to content
Browse files

Use program_exists? instead of program_in_path?

This additionally checks that the program exists and is executable if
the path given is either a path or a program name.
  • Loading branch information...
1 parent b68296b commit eed91f9dd58402b3849f62ea8d2aace7cefe3997 @jordansissel committed
View
2 spec/fpm/package/cpan_spec.rb
@@ -2,7 +2,7 @@
require "fpm" # local
require "fpm/package/cpan" # local
-have_cpanm = program_in_path?("cpanm")
+have_cpanm = program_exists?("cpanm")
if !have_cpanm
Cabin::Channel.get("rspec") \
.warn("Skipping CPAN#input tests because 'cpanm' isn't in your PATH")
View
4 spec/fpm/package/deb_spec.rb
@@ -6,7 +6,7 @@
describe FPM::Package::Deb do
# dpkg-deb lets us query deb package files.
# Comes with debian and ubuntu systems.
- have_dpkg_deb = program_in_path?("dpkg-deb")
+ have_dpkg_deb = program_exists?("dpkg-deb")
if !have_dpkg_deb
Cabin::Channel.get("rspec") \
.warn("Skipping some deb tests because 'dpkg-deb' isn't in your PATH")
@@ -29,7 +29,7 @@
it "should default to native" do
expected = ""
- if program_in_path?("dpkg")
+ if program_exists?("dpkg")
expected = %x{dpkg --print-architecture}.chomp
end
View
2 spec/fpm/package/gem_spec.rb
@@ -2,7 +2,7 @@
require "fpm" # local
require "fpm/package/gem" # local
-have_gem = program_in_path?("gem")
+have_gem = program_exists?("gem")
if !have_gem
Cabin::Channel.get("rspec") \
.warn("Skipping Gem#input tests because 'gem' isn't in your PATH")
View
2 spec/fpm/package/python_spec.rb
@@ -3,7 +3,7 @@
require "fpm/package/python" # local
def python_usable?
- return program_in_path?("python") && program_in_path?("easy_install")
+ return program_exists?("python") && program_exists?("easy_install")
end
if !python_usable?
View
8 spec/fpm/package/rpm_spec.rb
@@ -5,7 +5,7 @@
require "arr-pm/file" # gem 'arr-pm'
require "stud/temporary" # gem 'stud'
-if !program_in_path?("rpmbuild")
+if !program_exists?("rpmbuild")
Cabin::Channel.get("rspec") \
.warn("Skipping RPM#output tests because 'rpmbuild' isn't in your PATH")
end
@@ -110,7 +110,7 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end
end # context
end
- describe "#output", :if => program_in_path?("rpmbuild") do
+ describe "#output", :if => program_exists?("rpmbuild") do
context "package attributes" do
before :each do
@target = Stud::Temporary.pathname
@@ -312,7 +312,7 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end
end # package attributes
end # #output
- describe "regressions should not occur", :if => program_in_path?("rpmbuild") do
+ describe "regressions should not occur", :if => program_exists?("rpmbuild") do
before :each do
@tempfile_handle =
@target = Stud::Temporary.pathname
@@ -392,7 +392,7 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end
end
end # regression stuff
- describe "#output with digest and compression settings", :if => program_in_path?("rpmbuild") do
+ describe "#output with digest and compression settings", :if => program_exists?("rpmbuild") do
context "bzip2/sha1" do
before :each do
@target = Stud::Temporary.pathname
View
2 spec/spec_setup.rb
@@ -8,7 +8,7 @@
# put "lib" in RUBYLIB
$: << File.join(File.dirname(File.dirname(__FILE__)), "lib")
-# for method "program_in_path?" etc
+# for method "program_exists?" etc
require "fpm/util"
include FPM::Util

0 comments on commit eed91f9

Please sign in to comment.
Something went wrong with that request. Please try again.