Sha256: bd8bae21bb69cdc28b09f46a4b06a619c511afee6aced73934e87d324d05e99f

Contents?: true

Size: 1.28 KB

Versions: 27

Compression:

Stored size: 1.28 KB

Contents

require 'rubygems'
require 'bundler/setup'
require 'bundler/gem_tasks'

require 'rake'
require 'rspec'

# === Gems install tasks ===
Bundler::GemHelper.install_tasks

# require 'coveralls/rake/task'
# Coveralls::RakeTask.new

require_relative 'lib/locomotive/steam'

namespace :mongodb do
  namespace :test do
    desc 'Seed the MongoDB database with the dump of the Sample website'
    task :seed do
      root_path = File.expand_path(File.dirname(__FILE__))
      db_path   = File.join(root_path, 'spec', 'fixtures', 'mongodb')

      if database = ENV['DATABASE']
        dump_path = File.join(root_path, 'dump', database)

        `rm -rf #{db_path}`
        `mongodump --db #{database}`
        `mv #{dump_path} #{db_path}`
      end

      `mongo steam_test --eval "db.dropDatabase()"`
      `mongorestore -d steam_test #{db_path}`

      puts "Done! Update now the spec/support/helpers.rb file by setting the new id of the site returned by the mongodb_site_id method"
    end
  end
end

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec')

RSpec::Core::RakeTask.new('spec:integration') do |spec|
  spec.pattern = 'spec/integration/**/*_spec.rb'
end

RSpec::Core::RakeTask.new('spec:unit') do |spec|
  spec.pattern = 'spec/unit/**/*_spec.rb'
end

task default: ['mongodb:test:seed', :spec]

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
locomotivecms_steam-1.4.0.rc1 Rakefile
locomotivecms_steam-1.4.0.pre.rc.1 Rakefile
locomotivecms_steam-1.3.0 Rakefile
locomotivecms_steam-1.3.0.rc2 Rakefile
locomotivecms_steam-1.1.2 Rakefile
locomotivecms_steam-1.2.1 Rakefile
locomotivecms_steam-1.3.0.rc1 Rakefile
locomotivecms_steam-1.2.0 Rakefile
locomotivecms_steam-1.2.0.rc3 Rakefile
locomotivecms_steam-1.2.0.rc2 Rakefile
locomotivecms_steam-1.2.0.rc1 Rakefile
locomotivecms_steam-1.2.0.beta1 Rakefile
locomotivecms_steam-1.1.1 Rakefile
locomotivecms_steam-1.1.0 Rakefile
locomotivecms_steam-1.1.0.rc3 Rakefile
locomotivecms_steam-1.1.0.rc2 Rakefile
locomotivecms_steam-1.1.0.rc1 Rakefile
locomotivecms_steam-1.0.1 Rakefile
locomotivecms_steam-1.0.0 Rakefile
locomotivecms_steam-1.0.0.rc10 Rakefile