Permalink
Browse files

tiny fixes to test environment (not fixed fully)

  • Loading branch information...
1 parent 11072b7 commit 3bb8d00a1716ec62b71a8b3c3b76a5722fb9a17c @funny-falcon funny-falcon committed Mar 26, 2014
Showing with 10 additions and 9 deletions.
  1. +10 −9 test/helper.rb
View
@@ -1,6 +1,7 @@
require 'minitest/spec'
require 'rr'
require 'fileutils'
+require 'eventmachine'
require 'tarantool'
@@ -184,20 +185,23 @@ def self.promote_to_slave(slave, master)
module Helper
def tarantool_pipe
- $tarantool_pipe ||= begin
+ #$tarantool_pipe ||= begin
+ begin
cnf = {port: 33013, admin: 33015} #TCONFIG
- tarant = %W{tarantool -p #{cnf[:port]} -m #{cnf[:admin]}}
+ tarant = %W{tarantool -p #{cnf[:port]} -a #{cnf[:admin]}}
tarant = [{}, *tarant, :err => [:child, :out]]
IO.popen(tarant, 'w+').tap{|p| p.sync = true}
end
end
def exec_tarantool(cmd, lines_to_read)
cmd = cmd.gsub(/^\s+/, '')
- tarantool_pipe.puts(cmd)
- tarantool_pipe.flush
+ pipe = tarantool_pipe
+ pipe.puts(cmd)
+ pipe.flush
lines_to_read.times do
- tarantool_pipe.gets
+ #STDERR.puts pipe.gets
+ pipe.gets
end
end
@@ -284,14 +288,11 @@ def blockrun
yield
end
- def mock(u, meth, &block)
- u.define_singleton_method(meth, &block)
- end
end
class MiniTest::Unit::TestCase
include ::Helper
- include RR::Adapters::MiniTest
+ include ::RR::Adapters::MiniTest
end
class << MiniTest::Spec

0 comments on commit 3bb8d00

Please sign in to comment.