summaryrefslogtreecommitdiff
path: root/chef-config/Rakefile
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-06-06 17:39:12 -0700
committerJohn Keiser <john@johnkeiser.com>2016-06-06 17:39:12 -0700
commit79b29424cef808916faa1358204404ca5678adc2 (patch)
tree94b0cbcc892300c0c0a7cb8ff087f6d2346a4193 /chef-config/Rakefile
parent139b722e3825f10691f6bb2dcb9bfbf14915dc6e (diff)
downloadchef-79b29424cef808916faa1358204404ca5678adc2.tar.gz
Make chef-config Rakefile run without rspecjk/chef-config-no-rspec
Diffstat (limited to 'chef-config/Rakefile')
-rw-r--r--chef-config/Rakefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/chef-config/Rakefile b/chef-config/Rakefile
index 151c2754c3..46f87c96c9 100644
--- a/chef-config/Rakefile
+++ b/chef-config/Rakefile
@@ -1,4 +1,3 @@
-require "rspec/core/rake_task"
require "chef-config/package_task"
ChefConfig::PackageTask.new(File.expand_path("..", __FILE__), "ChefConfig") do |package|
@@ -7,7 +6,12 @@ end
task :default => :spec
-desc "Run standard specs"
-RSpec::Core::RakeTask.new(:spec) do |t|
- t.pattern = FileList["spec/**/*_spec.rb"]
+begin
+ require "rspec/core/rake_task"
+ desc "Run standard specs"
+ RSpec::Core::RakeTask.new(:spec) do |t|
+ t.pattern = FileList["spec/**/*_spec.rb"]
+ end
+rescue LoadError
+ STDERR.puts "\n*** RSpec not available. (sudo) gem install rspec to run unit tests. ***\n\n"
end