diff options
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/external_tests.rb | 16 | ||||
-rw-r--r-- | tasks/maintainers.rb | 8 | ||||
-rw-r--r-- | tasks/rspec.rb | 16 |
3 files changed, 20 insertions, 20 deletions
diff --git a/tasks/external_tests.rb b/tasks/external_tests.rb index 69c0712a12..2b461635f7 100644 --- a/tasks/external_tests.rb +++ b/tasks/external_tests.rb @@ -1,15 +1,15 @@ -require 'tempfile' -require 'bundler' +require "tempfile" +require "bundler" -CURRENT_GEM_NAME = 'chef' -CURRENT_GEM_PATH = File.expand_path('../..', __FILE__) +CURRENT_GEM_NAME = "chef" +CURRENT_GEM_PATH = File.expand_path("../..", __FILE__) def bundle_exec_with_chef(test_gem, commands) gem_path = Bundler.environment.specs[test_gem].first.full_gem_path gemfile_path = File.join(gem_path, "Gemfile.#{CURRENT_GEM_NAME}-external-test") gemfile = File.open(gemfile_path, "w") begin - IO.read(File.join(gem_path, 'Gemfile')).each_line do |line| + IO.read(File.join(gem_path, "Gemfile")).each_line do |line| if line =~ /^\s*gemspec/ next elsif line =~ /^\s*gem '#{CURRENT_GEM_NAME}'|\s*gem "#{CURRENT_GEM_NAME}"/ @@ -26,11 +26,11 @@ def bundle_exec_with_chef(test_gem, commands) gemfile.close Dir.chdir(gem_path) do Bundler.with_clean_env do - unless system({ 'RUBYOPT' => nil, 'GEMFILE_MOD' => nil }, "bundle install --gemfile #{gemfile_path}") + unless system({ "RUBYOPT" => nil, "GEMFILE_MOD" => nil }, "bundle install --gemfile #{gemfile_path}") raise "Error running bundle install --gemfile #{gemfile_path} in #{gem_path}: #{$?.exitstatus}\nGemfile:\n#{IO.read(gemfile_path)}" end Array(commands).each do |command| - unless system({ 'BUNDLE_GEMFILE' => gemfile_path, 'RUBYOPT' => nil, 'GEMFILE_MOD' => nil }, "bundle exec #{command}") + unless system({ "BUNDLE_GEMFILE" => gemfile_path, "RUBYOPT" => nil, "GEMFILE_MOD" => nil }, "bundle exec #{command}") raise "Error running bundle exec #{command} in #{gem_path} with BUNDLE_GEMFILE=#{gemfile_path}: #{$?.exitstatus}\nGemfile:\n#{IO.read(gemfile_path)}" end end @@ -58,7 +58,7 @@ EXTERNAL_PROJECTS = { task :external_specs => EXTERNAL_PROJECTS.keys.map { |g| :"#{g.sub("-","_")}_spec" } EXTERNAL_PROJECTS.each do |test_gem, commands| - task :"#{test_gem.gsub('-','_')}_spec" do + task :"#{test_gem.gsub("-","_")}_spec" do bundle_exec_with_chef(test_gem, commands) end end diff --git a/tasks/maintainers.rb b/tasks/maintainers.rb index 73a422fc61..4b9f78be14 100644 --- a/tasks/maintainers.rb +++ b/tasks/maintainers.rb @@ -15,7 +15,7 @@ # limitations under the License. # -require 'rake' +require "rake" SOURCE = File.join(File.dirname(__FILE__), "..", "MAINTAINERS.toml") TARGET = File.join(File.dirname(__FILE__), "..", "MAINTAINERS.md") @@ -28,9 +28,9 @@ REPOSITORIES = ["chef/chef", "chef/chef-census", "chef/chef-repo", "chef/mixlib-shellout", "chef/ohai", "chef/omnibus-chef"] begin - require 'tomlrb' - require 'octokit' - require 'pp' + require "tomlrb" + require "octokit" + require "pp" task :default => :generate namespace :maintainers do diff --git a/tasks/rspec.rb b/tasks/rspec.rb index 4d74fa0951..ff784c833c 100644 --- a/tasks/rspec.rb +++ b/tasks/rspec.rb @@ -17,13 +17,13 @@ # limitations under the License. # -require 'rubygems' -require 'rake' +require "rubygems" +require "rake" CHEF_ROOT = File.join(File.dirname(__FILE__), "..") begin - require 'rspec/core/rake_task' + require "rspec/core/rake_task" desc "Run specs for Chef's Components" @@ -44,13 +44,13 @@ begin RSpec::Core::RakeTask.new(:spec) do |t| # right now this just limits to functional + unit, but could also remove # individual tests marked long-running - t.pattern = FileList['spec/**/*_spec.rb'] + t.pattern = FileList["spec/**/*_spec.rb"] end namespace :spec do desc "Run all specs in spec directory with RCov" RSpec::Core::RakeTask.new(:rcov) do |t| - t.pattern = FileList['spec/**/*_spec.rb'] + t.pattern = FileList["spec/**/*_spec.rb"] t.rcov = true t.rcov_opts = lambda do IO.readlines("#{CHEF_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten @@ -59,19 +59,19 @@ begin desc "Run all specs in spec directory" RSpec::Core::RakeTask.new(:all) do |t| - t.pattern = FileList['spec/**/*_spec.rb'] + t.pattern = FileList["spec/**/*_spec.rb"] end desc "Print Specdoc for all specs" RSpec::Core::RakeTask.new(:doc) do |t| t.rspec_opts = ["--format", "specdoc", "--dry-run"] - t.pattern = FileList['spec/**/*_spec.rb'] + t.pattern = FileList["spec/**/*_spec.rb"] end desc "Run the specs under spec/unit with activesupport loaded" RSpec::Core::RakeTask.new(:activesupport) do |t| t.rspec_opts = ["--require active_support/core_ext"] - t.pattern = FileList['spec/unit/**/*_spec.rb'] + t.pattern = FileList["spec/unit/**/*_spec.rb"] end [:unit, :functional, :integration, :stress].each do |sub| |