From 9c30b5286c3e47a85f313654a285be8fbce9fd13 Mon Sep 17 00:00:00 2001 From: Mike Dvorkin Date: Fri, 6 May 2011 15:20:52 -0700 Subject: [PATCH] Get rid of old Rspec 1.3 dependency --- README.md | 6 +++--- Rakefile | 37 +++++++++---------------------------- awesome_print.gemspec | 6 +++--- spec/spec_helper.rb | 14 ++------------ 4 files changed, 17 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index d38372e..b02b9e6 100644 --- a/README.md +++ b/README.md @@ -252,9 +252,9 @@ For example: ### Running Specs ### - $ rake spec # Entire spec suite. - $ ruby -rubygems spec/logger_spec.rb # Individual spec file (Ruby 1.8.7 and RSpec 1.3+) - $ rspec spec/logger_spec.rb # Individual spec file (Ruby 1.9.2 and RSpec 2.0+) + $ gem install rspec # RSpec 2.x is the requirement. + $ rake spec # Run the entire spec suite. + $ rspec spec/logger_spec.rb # Run individual spec file. ### Note on Patches/Pull Requests ### * Fork the project on Github. diff --git a/Rakefile b/Rakefile index 5f1eef2..04c6d59 100644 --- a/Rakefile +++ b/Rakefile @@ -11,11 +11,7 @@ begin gem.email = "mike@dvorkin.net" gem.homepage = "http://github.com/michaeldv/awesome_print" gem.authors = ["Michael Dvorkin"] - if RUBY_VERSION.to_f >= 1.9 - gem.add_development_dependency "rspec", ">= 2.0.0" - else - gem.add_development_dependency "rspec", ">= 1.3.0" - end + gem.add_development_dependency "rspec", ">= 2.5.0" gem.files = FileList["[A-Z]*", "lib/**/*.rb", "rails/*.rb", "spec/*", "init.rb"] gem.has_rdoc = false # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings @@ -25,30 +21,15 @@ rescue LoadError puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" end -if RUBY_VERSION.to_f >= 1.9 - require "rspec/core/rake_task" # RSpec 2.0 - RSpec::Core::RakeTask.new(:spec) do |spec| - spec.pattern = 'spec/**/*_spec.rb' - spec.rspec_opts = ['--color'] - end +require "rspec/core/rake_task" +RSpec::Core::RakeTask.new(:spec) do |spec| + spec.pattern = 'spec/**/*_spec.rb' + spec.rspec_opts = ['--color'] +end - RSpec::Core::RakeTask.new(:rcov) do |spec| - spec.rcov = true - spec.rcov_opts = %q[--exclude "spec"] - 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 +RSpec::Core::RakeTask.new(:rcov) do |spec| + spec.rcov = true + spec.rcov_opts = %q[--exclude "spec"] end task :spec => :check_dependencies diff --git a/awesome_print.gemspec b/awesome_print.gemspec index fc8c823..bf1a88a 100644 --- a/awesome_print.gemspec +++ b/awesome_print.gemspec @@ -66,12 +66,12 @@ Gem::Specification.new do |s| s.specification_version = 3 if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_development_dependency(%q, [">= 1.3.0"]) + s.add_development_dependency(%q, [">= 2.5.0"]) else - s.add_dependency(%q, [">= 1.3.0"]) + s.add_dependency(%q, [">= 2.5.0"]) end else - s.add_dependency(%q, [">= 1.3.0"]) + s.add_dependency(%q, [">= 2.5.0"]) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b518b8b..ebcee74 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,24 +4,14 @@ # See LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ # -# Running specs with Ruby 1.8.7 and RSpec 1.3+: +# Running specs from the command line: # $ rake spec # Entire spec suite. -# $ ruby -rubygems spec/logger_spec.rb # Individual spec file. -# -# Running specs with Ruby 1.9.2 and RSpec 2.0+: -# $ rake spec # Entire spec suite. -# $ rspec spec/logger_spec.rb # Individual spec file. +# $ ruby -S rspec spec/logger_spec.rb # Individual spec file. # $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'ap' -if RUBY_VERSION.to_f < 1.9 - require 'rspec' - require 'rspec/autorun' - require 'rubygems' -end - def stub_dotfile! dotfile = File.join(ENV["HOME"], ".aprc") File.should_receive(:readable?).at_least(:once).with(dotfile).and_return(false)