Rakefile in postit-0.1.1 vs Rakefile in postit-0.1.2
- old
+ new
@@ -2,41 +2,51 @@
GEMSPEC = Gem::Specification.load('postit.gemspec')
desc "Installs all development dependencies"
task :bootstrap do
GEMSPEC.development_dependencies.each do |dep|
+ next if dep.name == 'rubocop' && RUBY_VERSION < '1.9.3'
sh 'gem', 'install', dep.name, '-v', dep.requirement.to_s
end
end
begin
GEMSPEC.development_dependencies.each do |dep|
+ next if dep.name == 'rubocop' && RUBY_VERSION < '1.9.3'
gem dep.name, dep.requirement.to_s
end
+Gem.finish_resolve if Gem.respond_to?(:finish_resolve)
require 'bundler/gem_tasks'
require 'tmpdir'
-desc 'Run the specs'
-task :spec do
- puts 'Running specs...'
+desc 'Run the integration specs'
+task :integration_spec do
+ print 'Running integration specs'
files = FileList['spec/**/*_spec.sh'].shuffle.map { |s| File.expand_path(s) }
files.each do |spec|
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
rubyopt = "RUBYOPT='-I#{File.expand_path('../lib', __FILE__)}'"
path = %(PATH="#{File.expand_path('../exe', __FILE__)}:$PATH")
- sh "#{rubyopt} #{path} sh '#{spec}'", verbose: false
+ sh "#{rubyopt} #{path} sh '#{spec}'", :verbose => false
end
end
end
puts "\n\n"
end
-require 'rubocop/rake_task'
-RuboCop::RakeTask.new
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new
-task :ci => [:spec, :rubocop]
+begin
+ require 'rubocop/rake_task'
+ RuboCop::RakeTask.new
+rescue LoadError
+ task :rubocop
+end
+
+task :default => [:spec, :integration_spec, :rubocop]
rescue LoadError, NameError
warn "Please run rake bootstrap"
end