Sha256: 0df862b917a66110c6f2afee0b2c2d5955417dfaa7b4ea0389ed8d074618456a

Contents?: true

Size: 822 Bytes

Versions: 7

Compression:

Stored size: 822 Bytes

Contents

require 'bundler/gem_tasks'
require 'rake/testtask'
require 'open3'

Rake::TestTask.new do |t|
  t.pattern = 'spec/**/*_spec.rb'
end

namespace :spec do
  desc 'prepare the spec environment, initializing the sandbox dir'
  task :prepare do
    $stdout.puts '===> Initializing `spec/sandbox` directory with bundler'

    # remove bundler env vars for the Open3 process.
    bundler_keys = ENV.select { |var, _| var.to_s.match(/\ABUNDLE/) }.keys
    env = bundler_keys.reduce({}) do |hash, (k,_)|
      hash[k] = nil
      hash
    end

    options = { chdir: 'spec/sandbox'}
    Open3.popen2e(env, 'bundle install', options) do |stdin, stdout, thread|
      while line = stdout.gets
        $stdout.puts line.chomp
      end

      stdin.close
      stdout.close
    end
  end
end
task spec: [:test]

task default: [:test]

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
izanami-0.20.0 Rakefile
izanami-0.19.0 Rakefile
izanami-0.18.0 Rakefile
izanami-0.17.0 Rakefile
izanami-0.16.0 Rakefile
izanami-0.15.0 Rakefile
izanami-0.14.0 Rakefile