summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-10-31 14:57:51 -0700
committerClaire McQuin <claire@getchef.com>2014-10-31 14:57:51 -0700
commitf3a8fb5ccf95338e41d34f84215310912e576695 (patch)
treedc108b79ff48fc4858f4934aeeda6d08f6ebeed5
parent55aa41abeb1dfb98290bae79c492006080ad8136 (diff)
downloadchef-f3a8fb5ccf95338e41d34f84215310912e576695.tar.gz
Modify pedant to run w/o chef
-rw-r--r--pedant.gemfile1
-rw-r--r--spec/support/pedant/Gemfile3
-rw-r--r--spec/support/pedant/run_pedant.rb26
3 files changed, 12 insertions, 18 deletions
diff --git a/pedant.gemfile b/pedant.gemfile
index 84b94b1a98..baa3e9aece 100644
--- a/pedant.gemfile
+++ b/pedant.gemfile
@@ -2,7 +2,6 @@ source "https://rubygems.org"
gemspec :name => "chef"
gem 'rest-client', :github => 'opscode/rest-client', :branch => 'lcg/1.6.7-version-lying'
-gem 'chef-pedant', :github => 'opscode/chef-pedant', :branch => "rspec-3-update"
# TODO figure out how to grab this stuff from the main Gemfile
gem "activesupport", "< 4.0.0", :group => :compat_testing, :platform => "ruby"
diff --git a/spec/support/pedant/Gemfile b/spec/support/pedant/Gemfile
new file mode 100644
index 0000000000..fee339f49c
--- /dev/null
+++ b/spec/support/pedant/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem 'chef-pedant', :github => 'opscode/chef-pedant', :branch => "rspec-3-update"
diff --git a/spec/support/pedant/run_pedant.rb b/spec/support/pedant/run_pedant.rb
index abee67103c..fdefd2a728 100644
--- a/spec/support/pedant/run_pedant.rb
+++ b/spec/support/pedant/run_pedant.rb
@@ -8,6 +8,7 @@ require 'chef/chef_fs/config'
require 'tmpdir'
require 'fileutils'
require 'chef/version'
+require 'chef/mixin/shell_out'
def start_server(chef_repo_path)
Dir.mkdir(chef_repo_path) if !File.exists?(chef_repo_path)
@@ -38,27 +39,18 @@ begin
# Capture setup data into master_chef_repo_path
server = start_server(chef_repo_path)
- require 'pedant'
- require 'pedant/opensource'
+ include Chef::Mixin::ShellOut
- #Pedant::Config.rerun = true
-
- Pedant.config.suite = 'api'
- Pedant.config[:config_file] = 'spec/support/pedant/pedant_config.rb'
- Pedant.config.chef_server = server.url
- Pedant.setup([
- '--skip-knife',
- '--skip-validation',
- '--skip-authentication',
- '--skip-authorization',
- '--skip-omnibus'
- ])
-
- result = RSpec::Core::Runner.run(Pedant.config.rspec_args)
+ shell_out("bundle install --gemfile spec/support/pedant/Gemfile")
+ so = shell_out("bundle exec chef-pedant" +
+ " --config spec/support/pedant/pedant_config.rb" +
+ " --server #{server.url}" +
+ " --skip-knife --skip-validation --skip-authentication" +
+ " --skip-authorization --skip-omnibus")
server.stop if server.running?
ensure
FileUtils.remove_entry_secure(tmpdir) if tmpdir
end
-exit(result)
+exit(so.exitstatus)