global_uid 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/global_uid/base.rb +2 -1
- data/test/config/database.yml +20 -0
- data/test/config/database.yml.example +3 -3
- data/test/global_uid_test.rb +3 -3
- data/test/test.log +13336 -0
- data/test/test_helper.rb +2 -0
- metadata +313 -33
data/lib/global_uid/base.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
test:
|
2
|
+
adapter: mysql
|
3
|
+
encoding: utf8
|
4
|
+
database: global_uid_test
|
5
|
+
username: root
|
6
|
+
password:
|
7
|
+
|
8
|
+
test_id_server_1:
|
9
|
+
adapter: mysql
|
10
|
+
encoding: utf8
|
11
|
+
database: global_uid_test_id_server_1
|
12
|
+
username: root
|
13
|
+
password:
|
14
|
+
|
15
|
+
test_id_server_2:
|
16
|
+
adapter: mysql
|
17
|
+
encoding: utf8
|
18
|
+
database: global_uid_test_id_server_2
|
19
|
+
username: root
|
20
|
+
password:
|
@@ -1,19 +1,19 @@
|
|
1
1
|
test:
|
2
|
-
adapter:
|
2
|
+
adapter: mysql
|
3
3
|
encoding: utf8
|
4
4
|
database: global_uid_test
|
5
5
|
username: root
|
6
6
|
password:
|
7
7
|
|
8
8
|
test_id_server_1:
|
9
|
-
adapter:
|
9
|
+
adapter: mysql
|
10
10
|
encoding: utf8
|
11
11
|
database: global_uid_test_id_server_1
|
12
12
|
username: root
|
13
13
|
password:
|
14
14
|
|
15
15
|
test_id_server_2:
|
16
|
-
adapter:
|
16
|
+
adapter: mysql
|
17
17
|
encoding: utf8
|
18
18
|
database: global_uid_test_id_server_2
|
19
19
|
username: root
|
data/test/global_uid_test.rb
CHANGED
@@ -200,7 +200,7 @@ class GlobalUIDTest < ActiveSupport::TestCase
|
|
200
200
|
setup do
|
201
201
|
reset_connections!
|
202
202
|
@old_size = GlobalUid::Base.get_connections.size # prime them
|
203
|
-
GlobalUid::Base.get_connections.first.stubs(:
|
203
|
+
GlobalUid::Base.get_connections.first.stubs(:insert).raises(GlobalUid::TimeoutException)
|
204
204
|
# trigger the failure -- have to do it it a bunch of times, as one call might not hit the server
|
205
205
|
# Even so there's a 1/(2^32) possibility of this test failing.
|
206
206
|
32.times do WithGlobalUID.create! end
|
@@ -227,7 +227,7 @@ class GlobalUIDTest < ActiveSupport::TestCase
|
|
227
227
|
# would prefer to do the below, but need Mocha 0.9.10 to do so
|
228
228
|
# ActiveRecord::ConnectionAdapters::MysqlAdapter.any_instance.stubs(:execute).raises(ActiveRecord::StatementInvalid)
|
229
229
|
GlobalUid::Base.with_connections do |cx|
|
230
|
-
cx.stubs(:
|
230
|
+
cx.stubs(:insert).raises(ActiveRecord::StatementInvalid)
|
231
231
|
end
|
232
232
|
end
|
233
233
|
|
@@ -355,7 +355,7 @@ class GlobalUIDTest < ActiveSupport::TestCase
|
|
355
355
|
end
|
356
356
|
|
357
357
|
def show_create_sql(klass, table)
|
358
|
-
klass.connection.
|
358
|
+
klass.connection.select_rows("show create table #{table}")[0][1]
|
359
359
|
end
|
360
360
|
end
|
361
361
|
|