事件机出错



我正在使用正在发生的gem,这是一个事件机器库,用于在S3上持久化文件。当我运行rspec测试从aws桶"GET"一个文件时,它出错了。

错误O/p:

    RuntimeError: eventmachine not initialized: evma_connect_to_server
/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.3/lib/eventmachine.rb:665:in `connect_server'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.3/lib/eventmachine.rb:665:in `bind_connect'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/em-http-request-1.0.3/lib/em-http/http_connection.rb:54:in `activate_connection'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/em-http-request-1.0.3/lib/em-http/http_connection.rb:89:in `setup_request'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/em-http-request-1.0.3/lib/em-http/http_connection.rb:4:in `get'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/happening-0.2.5/lib/happening/s3/request.rb:35:in `execute'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/happening-0.2.5/lib/happening/s3/item.rb:44:in `get'

有人遇到过类似的问题吗?

thakns

这可以通过添加with_api

来解决
  it "should return pong response" do
    with_api API do
      get_request(path: "/api/ping") do |async|
        async.response.should == { ping: "pong" }.to_json
      end
    end
  end

其中API是继承自Goliath::API的api类

spec_helper.rb添加:

require 'goliath/test_helper'
RSpec.configure do |c|
  c.include Goliath::TestHelper, :example_group => {
    :file_path => /spec/api/
  }
end

相关内容

  • 没有找到相关文章