Rakefile in soaspec-0.0.38 vs Rakefile in soaspec-0.0.39
- old
+ new
@@ -4,20 +4,35 @@
ENV['folder'] ||= ''
ENV['test'] ||= ''
RSpec::Core::RakeTask.new(:run_spec) do |t|
- t.pattern = "spec/*/#{ENV['folder']}*/#{ENV['test']}*_spec.rb"
+ t.pattern = "{spec/*/#{ENV['folder']}*/#{ENV['test']},tmp/*/spec/}*_spec.rb"
end
desc 'Prepare log files'
task :logs do
mkdir_p 'logs'
touch 'logs/traffic.log'
end
+desc 'Use soaspec_init in tmp to generate test files. Used for verifying it'
+task :use_soaspec_init do
+ mkdir_p 'tmp'
+ mkdir_p 'tmp/init'
+ puts `cd tmp/init && ruby ../../exe/soaspec-init`
+end
+
+
desc 'Run tests'
-task :spec => %w[logs run_spec]
+task :spec => %w[clean clobber use_soaspec_init logs start_test_server run_spec]
task :default => :spec
+CLEAN.include 'tmp/*'
CLOBBER.include 'logs/*'
+
+desc 'Start virtual web service'
+task :start_test_server do
+ ENV['test_server_pid'] = Process.spawn('ruby', 'spec/test_server.rb').to_s #, err: "/dev/null").to_s - TODO: use to turn off debugging
+ puts 'Running test server at pid ' + ENV['test_server_pid']
+end