em-pg-client 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,39 +0,0 @@
1
- $:.unshift "lib"
2
- gem 'eventmachine', '= 0.12.10'
3
- gem 'pg', ENV['EM_PG_CLIENT_TEST_PG_VERSION']
4
- require 'date'
5
- require 'eventmachine'
6
- require 'pg/em'
7
- require 'em_client_common'
8
- RSpec.configure do |config|
9
- config.include(PGSpecMacros)
10
- end
11
-
12
- describe PG::EM::Client do
13
-
14
- include_context 'em-pg common before'
15
-
16
- it "should populate foo with some data " do
17
- values = @values.dup
18
- results = []
19
- do_query = proc do
20
- data, id = values.shift
21
- @client.query('INSERT INTO foo (id,cdate,data) VALUES($1,$2,$3) returning cdate', [id, DateTime.now, data]) do |result|
22
- result.should be_an_instance_of PG::Result
23
- results << DateTime.parse(result[0]['cdate'])
24
- if values.empty?
25
- @cdates.replace results
26
- results.length.should == @values.length
27
- results.each {|r| r.should be_an_instance_of DateTime }
28
- EM.stop
29
- else
30
- do_query.call
31
- end
32
- end.should be_a_kind_of ::EM::DefaultDeferrable
33
- end
34
- do_query.call
35
- end
36
-
37
- include_context 'em-pg common after'
38
-
39
- end