Added Dockerfile with some small updates

This commit is contained in:
Priit Tamboom 2014-09-08 16:07:09 +03:00
parent 6f3d3c849a
commit 7121eb5ae6
7 changed files with 81 additions and 40 deletions

View file

@ -1,35 +1,37 @@
require 'rspec/core/rake_task'
require 'open3'
if Rails.env.test?
require 'rspec/core/rake_task'
require 'open3'
desc 'Run all specs against server'
task 'test' do
test_against_server { Rake::Task['spec'].invoke }
end
desc 'Run all specs against server'
task 'test' do
test_against_server { Rake::Task['spec'].invoke }
end
desc 'Run EPP specs against server'
task 'test:epp' do
test_against_server { Rake::Task['spec:epp'].invoke }
end
desc 'Run EPP specs against server'
task 'test:epp' do
test_against_server { Rake::Task['spec:epp'].invoke }
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:other') do |t|
t.rspec_opts = '--tag ~epp'
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:other') do |t|
t.rspec_opts = '--tag ~epp'
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:all_but_features') do |t|
t.rspec_opts = '--tag ~feature'
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:all_but_features') do |t|
t.rspec_opts = '--tag ~feature'
end
Rake::Task[:default].prerequisites.clear
task default: :test
Rake::Task[:default].prerequisites.clear
task default: :test
def test_against_server
stdin, stdout, stderr, wait_thr = Open3.popen3('unicorn -E test -p 8989')
pid = wait_thr.pid
begin
yield
ensure
`kill #{pid}`
def test_against_server
stdin, stdout, stderr, wait_thr = Open3.popen3('unicorn -E test -p 8989')
pid = wait_thr.pid
begin
yield
ensure
`kill #{pid}`
end
end
end