From a4fe4598b681b75f5dc66e8193cefbf069cac728 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Wed, 26 Jan 2011 22:48:55 -0800 Subject: Refactor #6044 -- port testing to rspec2 We have moved to rspec2 for puppet, and facter should follow suit. --- Rakefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index ba939be..9b79613 100644 --- a/Rakefile +++ b/Rakefile @@ -4,8 +4,8 @@ $: << File.expand_path('lib') $LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks') require 'rubygems' -require 'spec' -require 'spec/rake/spectask' +require 'rspec' +require 'rspec/core/rake_task' begin require 'rcov' rescue LoadError @@ -62,12 +62,14 @@ task :default do sh %{rake -T} end -Spec::Rake::SpecTask.new(:spec) do |t| - t.spec_files = FileList['spec/**/*.rb'] +RSpec::Core::RakeTask.new do |t| + t.pattern ='spec/{unit,integration}/**/*.rb' + t.fail_on_error = false end -Spec::Rake::SpecTask.new('spec:rcov') do |t| - t.spec_files = FileList['spec/**/*.rb'] +RSpec::Core::RakeTask.new('spec:rcov') do |t| + t.pattern ='spec/{unit,integration}/**/*.rb' + t.fail_on_error = false if defined?(Rcov) t.rcov = true t.rcov_opts = ['--exclude', 'spec/*,test/*,results/*,/usr/lib/*,/usr/local/lib/*,gems/*'] -- cgit From 7a8be1677314ce3db6ae6590ae7d32a10605c8d3 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Thu, 27 Jan 2011 17:17:52 -0800 Subject: Refactor #6044 -- use _spec.rb as the pattern for spec tests. Rename all the spec tests to follow the rspec convention of *_spec.rb rather than unadorned *.rb; this also makes it easier to work with them consistently without using the Rakefile support that customizes that. --- Rakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 9b79613..9d7d906 100644 --- a/Rakefile +++ b/Rakefile @@ -63,12 +63,12 @@ task :default do end RSpec::Core::RakeTask.new do |t| - t.pattern ='spec/{unit,integration}/**/*.rb' + t.pattern ='spec/{unit,integration}/**/*_spec.rb' t.fail_on_error = false end RSpec::Core::RakeTask.new('spec:rcov') do |t| - t.pattern ='spec/{unit,integration}/**/*.rb' + t.pattern ='spec/{unit,integration}/**/*_spec.rb' t.fail_on_error = false if defined?(Rcov) t.rcov = true -- cgit