summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <mcquin@users.noreply.github.com>2014-11-03 16:48:38 -0800
committerClaire McQuin <mcquin@users.noreply.github.com>2014-11-03 16:48:38 -0800
commit4fa0ea6f9b942d407b83712ec53e19447ddfa39b (patch)
tree251d37ccb6cd43c779837b327a2d22d7ec3dfc8f
parenta8538036a21846e22d45296380d7e500688381f5 (diff)
parentf5498fe23f5b915ff5bb2707784191d9ab626a11 (diff)
downloadchef-4fa0ea6f9b942d407b83712ec53e19447ddfa39b.tar.gz
Merge pull request #2346 from opscode/tball/rspec3-fix
Getting pedant running with rspec 3
-rw-r--r--pedant.gemfile1
-rw-r--r--spec/support/pedant/Gemfile3
-rw-r--r--spec/support/pedant/run_pedant.rb31
3 files changed, 18 insertions, 17 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..d4224cd439
--- /dev/null
+++ b/spec/support/pedant/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem 'chef-pedant', :github => 'opscode/chef-pedant', :ref => "server-cli-option"
diff --git a/spec/support/pedant/run_pedant.rb b/spec/support/pedant/run_pedant.rb
index abee67103c..aac2c2df1a 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)
@@ -37,28 +38,26 @@ begin
# Capture setup data into master_chef_repo_path
server = start_server(chef_repo_path)
+ so = nil
- require 'pedant'
- require 'pedant/opensource'
+ include Chef::Mixin::ShellOut
- #Pedant::Config.rerun = true
+ Bundler.with_clean_env do
- 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'
- ])
+ shell_out("bundle install --gemfile spec/support/pedant/Gemfile", :live_stream => STDOUT)
- result = RSpec::Core::Runner.run(Pedant.config.rspec_args)
+ pedant_cmd = "chef-pedant " +
+ " --config spec/support/pedant/pedant_config.rb" +
+ " --server '#{server.url}'" +
+ " --skip-knife --skip-validation --skip-authentication" +
+ " --skip-authorization --skip-omnibus"
+ so = shell_out("bundle exec #{pedant_cmd}", :live_stream => STDOUT, :env => {'BUNDLE_GEMFILE' => 'spec/support/pedant/Gemfile'})
+
+ end
- server.stop if server.running?
ensure
+ server.stop if server && server.running?
FileUtils.remove_entry_secure(tmpdir) if tmpdir
end
-exit(result)
+exit(so.exitstatus)