spec/spec_helper.rb in mrjoy-bundler-audit-0.2.1 vs spec/spec_helper.rb in mrjoy-bundler-audit-0.3.1
- old
+ new
@@ -1,8 +1,5 @@
-require 'rubygems'
-require 'bundler'
-Bundler.require
require 'rspec'
require 'bundler/audit/version'
module Helpers
def sh(command, options={})
@@ -13,9 +10,17 @@
end
end
def decolorize(string)
string.gsub(/\e\[\d+m/, "")
+ end
+
+ def executable
+ File.expand_path(File.join('..','..','bin','bundle-audit'), __FILE__)
+ end
+
+ def audit_in_directory(additions, directory, options={})
+ Dir.chdir(directory) { decolorize(sh([executable, additions].compact.join(' '), options)) }
end
end
include Bundler::Audit