module Saorin::Test
Constants
- HOST
- PORT
Attributes
client[R]
pid[R]
server[R]
Public Instance Methods
create_test_client(options = {})
click to toggle source
# File lib/saorin/test.rb, line 67 def create_test_client(options = {}) @client = Saorin::Client.new({ :url => "http://127.0.0.1:#{PORT}" }.merge(options)) end
create_test_server(options = {})
click to toggle source
# File lib/saorin/test.rb, line 50 def create_test_server(options = {}) @pid = Process.fork do @server = Saorin::Server.new(Handler.new, { :host => HOST, :port => PORT, :Logger => Logger.new('/dev/null'), :AccessLog => [], }.merge(options)) @server.start end sleep 1 end
shutdown_test_server()
click to toggle source
# File lib/saorin/test.rb, line 63 def shutdown_test_server Process.kill :TERM, @pid end
test_batch()
click to toggle source
# File lib/saorin/test.rb, line 81 def test_batch @client.batch end
test_call(*args)
click to toggle source
# File lib/saorin/test.rb, line 73 def test_call(*args) @client.call *args end
test_notify(*args)
click to toggle source
# File lib/saorin/test.rb, line 77 def test_notify(*args) @client.notify *args end