Sha256: 15bb1789d47a9a648a3c50cfd23a790a76ce598152892d34e24ea7b2b1f49115

Contents?: true

Size: 610 Bytes

Versions: 6

Compression:

Stored size: 610 Bytes

Contents

# encoding: UTF-8
if defined? EventMachine && defined? Fiber
  require 'spec_helper'
  require 'mysql2/em_fiber'

  describe Mysql2::EM::Fiber::Client do
    it 'should support queries' do
      results = []
      EM.run do
        Fiber.new {
          client1 = Mysql2::EM::Fiber::Client.new DatabaseCredentials['root']
          results = client1.query "SELECT sleep(0.1) as first_query"
          EM.stop_event_loop
        }.resume
      end

      results.first.keys.should include("first_query")
    end
  end
else
  puts "Either EventMachine or Fibers not available. Skipping tests that use them."
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mysql2-0.2.19b6 spec/em/em_fiber_spec.rb
mysql2-0.2.19b5 spec/em/em_fiber_spec.rb
mysql2-0.2.19b4 spec/em/em_fiber_spec.rb
mysql2-0.2.19b3 spec/em/em_fiber_spec.rb
mysql2-0.2.19b2 spec/em/em_fiber_spec.rb
mysql2-0.2.19b1 spec/em/em_fiber_spec.rb