给出的示例屈应用 post '/1' do
sleep(1) until @2
0
end
post '/2' do
@2 = true
0
end
和示例测试RSpec的 describe 'test' do
it 'does /1' do
post '/1'
expect(last_response.body)
我已经在Sinatra中构建了一个简单的API,目的是使用Docker设置部署管道。我现在处于一个可以轻松切换Sinatra的阶段,目前我可能会这样做的原因之一。 我曾经写过使用Express的API,它是琐碎重复使用测试,以测试部署:从 # Testing the code
chai.request(app)
.get('/')
# Testing a deployment
c
这里是我的架申请: class MainAppLogic
def initialize
Rack::Server.start(:app =>Server, :server => "WEBrick", :Port => "8080")
end
end
class Server
def self.call(env)
return [200,