1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Made 'rake spec' work with Ruby 1.9.2/RSpec 2

This commit is contained in:
Mike Dvorkin 2010-10-31 16:10:08 -07:00
parent 5f78c06a05
commit 816b5a6513
3 changed files with 30 additions and 14 deletions

View file

@ -21,16 +21,30 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end end
require 'spec/rake/spectask' if RUBY_VERSION.to_f >= 1.9
Spec::Rake::SpecTask.new(:spec) do |spec| require "rspec/core/rake_task" # RSpec 2.0
spec.libs << 'lib' << 'spec' RSpec::Core::RakeTask.new(:spec) do |spec|
spec.spec_files = FileList['spec/**/*_spec.rb'] spec.pattern = 'spec/**/*_spec.rb'
end spec.rspec_opts = ['--color']
end
Spec::Rake::SpecTask.new(:rcov) do |spec| RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.libs << 'lib' << 'spec' spec.rcov = true
spec.pattern = 'spec/**/*_spec.rb' spec.rcov_opts = %q[--exclude "spec"]
spec.rcov = true end
else
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_opts = ['--color']
spec.spec_files = FileList['spec/**/*_spec.rb']
end
Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.libs << 'lib' << 'spec'
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end
end end
task :spec => :check_dependencies task :spec => :check_dependencies

View file

@ -1 +0,0 @@
--color

View file

@ -1,11 +1,14 @@
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ap' require 'ap'
require 'spec'
require 'spec/autorun'
require 'rubygems'
Spec::Runner.configure do |config| if RUBY_VERSION.to_f < 1.9
require 'spec'
require 'spec/autorun'
require 'rubygems'
Spec::Runner.configure do |config|
end
end end
def stub_dotfile! def stub_dotfile!