Sha256: fd6efd1904e3ab95271a6548e3570c967535ec1a8ea302c6b931d691f7ed2e9b

Contents?: true

Size: 1.12 KB

Versions: 9

Compression:

Stored size: 1.12 KB

Contents

# -*- coding: utf-8 -*-
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

ENV['DEFAULT_HTTP_PORT'] ||= '4000'
ENV['DEFAULT_HTTPS_PORT'] ||= '4001'

require 'fileutils'

def system!(cmd)
  puts "now executing: #{cmd}"
  IO.popen("#{cmd} 2>&1") do |io|
    while line = io.gets
      puts line
    end
  end

  if $?.exitstatus != 0
    exit(1)
  end
end

desc "test with fontana-LibgssTest"
task :test do
  fileutils = FileUtils::Verbose
  __dir__ = File.expand_path("..", __FILE__)
  sample_dir = File.join(__dir__, "fontana_sample")

  if Dir["#{sample_dir}/*"].empty?
    raise "#{sample_dir} is empty. You have to do `git submodule update --init` before `rake test`"
  end

  fileutils.chdir(sample_dir){ system!("export FONTANA_APP_MODE=test && bundle exec rake vendor:fontana:prepare test:servers:start") }
  begin
    fileutils.chdir(__dir__) do
      Rake::Task["spec"].execute
    end
  ensure
    fileutils.chdir(sample_dir){ system!("rake test:servers:stop") }
  end

  # 最後の子プロセスの終了ステータスで終了します
  exit($?.exitstatus || 1)
end

task :default => :test

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
libgss-0.11.0 Rakefile
libgss-0.10.0 Rakefile
libgss-0.9.0 Rakefile
libgss-0.8.4 Rakefile
libgss-0.8.3 Rakefile
libgss-0.8.2 Rakefile
libgss-0.8.1 Rakefile
libgss-0.8.0 Rakefile
libgss-0.7.6 Rakefile