mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Get rid of old Rspec 1.3 dependency
This commit is contained in:
parent
437810bff5
commit
9c30b5286c
4 changed files with 17 additions and 46 deletions
|
@ -252,9 +252,9 @@ For example:
|
||||||
|
|
||||||
### Running Specs ###
|
### Running Specs ###
|
||||||
|
|
||||||
$ rake spec # Entire spec suite.
|
$ gem install rspec # RSpec 2.x is the requirement.
|
||||||
$ ruby -rubygems spec/logger_spec.rb # Individual spec file (Ruby 1.8.7 and RSpec 1.3+)
|
$ rake spec # Run the entire spec suite.
|
||||||
$ rspec spec/logger_spec.rb # Individual spec file (Ruby 1.9.2 and RSpec 2.0+)
|
$ rspec spec/logger_spec.rb # Run individual spec file.
|
||||||
|
|
||||||
### Note on Patches/Pull Requests ###
|
### Note on Patches/Pull Requests ###
|
||||||
* Fork the project on Github.
|
* Fork the project on Github.
|
||||||
|
|
37
Rakefile
37
Rakefile
|
@ -11,11 +11,7 @@ begin
|
||||||
gem.email = "mike@dvorkin.net"
|
gem.email = "mike@dvorkin.net"
|
||||||
gem.homepage = "http://github.com/michaeldv/awesome_print"
|
gem.homepage = "http://github.com/michaeldv/awesome_print"
|
||||||
gem.authors = ["Michael Dvorkin"]
|
gem.authors = ["Michael Dvorkin"]
|
||||||
if RUBY_VERSION.to_f >= 1.9
|
gem.add_development_dependency "rspec", ">= 2.5.0"
|
||||||
gem.add_development_dependency "rspec", ">= 2.0.0"
|
|
||||||
else
|
|
||||||
gem.add_development_dependency "rspec", ">= 1.3.0"
|
|
||||||
end
|
|
||||||
gem.files = FileList["[A-Z]*", "lib/**/*.rb", "rails/*.rb", "spec/*", "init.rb"]
|
gem.files = FileList["[A-Z]*", "lib/**/*.rb", "rails/*.rb", "spec/*", "init.rb"]
|
||||||
gem.has_rdoc = false
|
gem.has_rdoc = false
|
||||||
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
# 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"
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
||||||
end
|
end
|
||||||
|
|
||||||
if RUBY_VERSION.to_f >= 1.9
|
require "rspec/core/rake_task"
|
||||||
require "rspec/core/rake_task" # RSpec 2.0
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
||||||
RSpec::Core::RakeTask.new(:spec) do |spec|
|
spec.pattern = 'spec/**/*_spec.rb'
|
||||||
spec.pattern = 'spec/**/*_spec.rb'
|
spec.rspec_opts = ['--color']
|
||||||
spec.rspec_opts = ['--color']
|
end
|
||||||
end
|
|
||||||
|
|
||||||
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
||||||
spec.rcov = true
|
spec.rcov = true
|
||||||
spec.rcov_opts = %q[--exclude "spec"]
|
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
task :spec => :check_dependencies
|
task :spec => :check_dependencies
|
||||||
|
|
|
@ -66,12 +66,12 @@ Gem::Specification.new do |s|
|
||||||
s.specification_version = 3
|
s.specification_version = 3
|
||||||
|
|
||||||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
||||||
s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
|
s.add_development_dependency(%q<rspec>, [">= 2.5.0"])
|
||||||
else
|
else
|
||||||
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
s.add_dependency(%q<rspec>, [">= 2.5.0"])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
s.add_dependency(%q<rspec>, [">= 2.5.0"])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,24 +4,14 @@
|
||||||
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
# 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.
|
# $ rake spec # Entire spec suite.
|
||||||
# $ ruby -rubygems spec/logger_spec.rb # Individual spec file.
|
# $ ruby -S rspec 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.
|
|
||||||
#
|
#
|
||||||
$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'
|
||||||
|
|
||||||
if RUBY_VERSION.to_f < 1.9
|
|
||||||
require 'rspec'
|
|
||||||
require 'rspec/autorun'
|
|
||||||
require 'rubygems'
|
|
||||||
end
|
|
||||||
|
|
||||||
def stub_dotfile!
|
def stub_dotfile!
|
||||||
dotfile = File.join(ENV["HOME"], ".aprc")
|
dotfile = File.join(ENV["HOME"], ".aprc")
|
||||||
File.should_receive(:readable?).at_least(:once).with(dotfile).and_return(false)
|
File.should_receive(:readable?).at_least(:once).with(dotfile).and_return(false)
|
||||||
|
|
Loading…
Reference in a new issue