Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

76 lines (61 sloc) 1.902 kb
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
gemfile = File.expand_path('../spec/test_app/Gemfile', __FILE__)
if File.exists?(gemfile) && (%w(spec cucumber).include?(ARGV.first.to_s) || ARGV.size == 0)
require 'bundler'
ENV['BUNDLE_GEMFILE'] = gemfile
Bundler.setup
require 'rspec'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
require 'cucumber/rake/task'
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format progress}
end
end
desc "Default Task"
task :default => [:spec, :cucumber ]
spec = eval(File.read('spree_correios_shipping.gemspec'))
Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec
end
desc "Release to gemcutter"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
Rake::Task['gem:push'].invoke
end
desc "Default Task"
task :default => [ :spec ]
desc "Regenerates a rails 3 app for testing"
task :test_app do
require '../spree/lib/generators/spree/test_app_generator'
class SpreeCorreiosShippingTestAppGenerator < Spree::Generators::TestAppGenerator
def install_gems
inside "test_app" do
run 'bundle exec rake spree_core:install'
run 'bundle exec rake spree_correios_shipping:install'
end
end
def migrate_db
run_migrations
end
protected
def full_path_for_local_gems
<<-gems
gem 'spree_core', :path => \'#{File.join(File.dirname(__FILE__), "../spree/", "core")}\'
gem 'spree_correios_shipping', :path => \'#{File.dirname(__FILE__)}\'
gems
end
end
SpreeCorreiosShippingTestAppGenerator.start
end
namespace :test_app do
desc 'Rebuild test and cucumber databases'
task :rebuild_dbs do
system("cd spec/test_app && bundle exec rake db:drop db:migrate RAILS_ENV=test && rake db:drop db:migrate RAILS_ENV=cucumber")
end
end
Jump to Line
Something went wrong with that request. Please try again.