sam / do fork watch download tarball
public
Rubygem
Description: DataObjects
Homepage: http://rubyforge.org/projects/dorb
Clone URL: git://github.com/sam/do.git
Search Repo:
Updated all drivers to handle Integer as a bind value type

* Added rake install task to do Rakefile
* Fixed whitespace in JDBC driver lib/specs
dkubb (author)
Thu May 15 13:48:19 -0700 2008
commit  c540d9f98ad08607081c6a28a791908e39557a59
tree    4fae23ab42d7cc97ecde171b2d22a4b175f90d20
parent  0da60a83e284ec987bdc3bdcfd82f7fe9b0bd221
...
10
11
12
 
 
 
13
14
15
16
17
 
 
 
18
19
20
21
22
 
 
 
23
24
 
 
25
26
27
...
31
32
33
34
 
35
36
37
...
54
55
56
57
 
58
59
60
...
68
69
70
71
 
72
73
74
...
10
11
12
13
14
15
16
17
18
19
 
20
21
22
23
 
 
 
 
24
25
26
27
28
29
30
31
32
33
...
37
38
39
 
40
41
42
43
...
60
61
62
 
63
64
65
66
...
74
75
76
 
77
78
79
80
0
@@ -10,18 +10,24 @@
0
 
0
 DIR = Pathname(__FILE__).dirname.expand_path.to_s
0
 
1
+WIN32 = (PLATFORM =~ /win32|cygwin/) rescue nil
0
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
0
+
0
 # projects = %w[data_objects do_jdbc do_mysql do_postgres do_sqlite3]
0
 # Took out do_jdbc since it doesn't build yet.
0
 projects = %w[data_objects do_mysql do_postgres do_sqlite3]
0
 
0
-namespace :do do
0
+desc 'Install the do gems'
0
+task :install => [ 'ci:install_all' ]
0
+
0
 desc 'Run specifications'
0
- Spec::Rake::SpecTask.new(:spec) do |t|
0
- t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
0
- t.spec_files = Pathname.glob(Pathname.new(__FILE__).parent.join("**").join("spec").join("**").join("*_spec.rb").to_s)
0
- end
0
+Spec::Rake::SpecTask.new(:spec) do |t|
0
+ t.spec_opts << '--format specdoc' << '--color'
0
+ t.spec_files = Pathname.glob(Pathname.new(__FILE__).parent + '**/spec/**/*_spec.rb')
0
 end
0
 
0
+task 'do:spec' => [ 'spec' ]
0
+
0
 namespace :ci do
0
 
0
   projects.each do |gem_name|
0
@@ -31,7 +37,7 @@
0
       Rake::Task["ci:run_all"].invoke
0
     end
0
   end
0
-
0
+
0
   task :install_all do
0
     projects.each do |gem_name|
0
       cd(File.join(File.dirname(__FILE__), gem_name))
0
@@ -54,7 +60,7 @@
0
   end
0
 
0
   task :uninstall do
0
- sh %{#{'sudo' unless ENV['SUDOLESS']} gem uninstall #{ENV['gem_name']} --ignore-dependencies} rescue nil
0
+ sh %{#{SUDO} gem uninstall #{ENV['gem_name']} --ignore-dependencies} rescue nil
0
   end
0
 
0
   task :publish do
0
@@ -68,7 +74,7 @@
0
 
0
   task :define_tasks do
0
     gem_name = ENV['gem_name']
0
-
0
+
0
     unless FileList["#{DIR}/#{gem_name}/ext/**/extconf.rb"].empty?
0
       file "#{gem_name}/Makefile" => FileList["#{DIR}/#{gem_name}/ext/**/extconf.rb", "#{DIR}/#{gem_name}/ext/**/*.c", "#{DIR}/#{gem_name}/ext/**/*.h"] do
0
         system("cd #{gem_name} && ruby ext/extconf.rb")
...
4
5
6
 
 
 
7
8
9
10
...
25
26
27
28
29
30
31
32
33
 
34
35
36
...
4
5
6
7
8
9
10
11
12
13
...
28
29
30
 
 
 
 
31
 
32
33
34
35
0
@@ -4,6 +4,9 @@
0
 require 'spec/rake/spectask'
0
 require 'pathname'
0
 
0
+WIN32 = (PLATFORM =~ /win32|cygwin/) rescue nil
0
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
0
+
0
 spec = Gem::Specification.new do |s|
0
   s.name = 'data_objects'
0
   s.version = '0.9.0'
0
0
@@ -25,12 +28,8 @@
0
   pkg.gem_spec = spec
0
 end
0
 
0
-windows = (PLATFORM =~ /win32|cygwin/) rescue nil
0
-
0
-SUDO = windows ? "" : "sudo"
0
-
0
 task :install => [ :package ] do
0
- sh %{#{SUDO unless ENV['SUDOLESS']} gem install --local pkg/#{spec.name}-#{spec.version} --no-update-sources}, :verbose => false
0
+ sh %{#{SUDO} gem install --local pkg/#{spec.name}-#{spec.version} --no-update-sources}, :verbose => false
0
 end
0
 
0
 desc 'Run specifications'
...
2
3
4
 
 
 
5
6
7
8
...
24
25
26
27
28
29
30
31
32
 
33
34
35
...
2
3
4
5
6
7
8
9
10
11
...
27
28
29
 
 
 
 
30
 
31
32
33
34
0
@@ -2,6 +2,9 @@
0
 require 'rake/gempackagetask'
0
 require 'spec/rake/spectask'
0
 
0
+WIN32 = (PLATFORM =~ /win32|cygwin/) rescue nil
0
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
0
+
0
 spec = Gem::Specification.new do |s|
0
   s.name = "do_jdbc"
0
   s.version = "0.9.0"
0
0
@@ -24,12 +27,8 @@
0
   pkg.gem_spec = spec
0
 end
0
 
0
-windows = (PLATFORM =~ /win32|cygwin/) rescue nil
0
-
0
-SUDO = windows ? "" : "sudo"
0
-
0
 task :install => [:package] do
0
- sh %{#{SUDO unless ENV['SUDOLESS']} gem install --local pkg/#{spec.name}-#{spec.version} --no-update-sources}
0
+ sh %{#{SUDO} gem install --local pkg/#{spec.name}-#{spec.version} --no-update-sources}
0
 end
0
 
0
 desc "Run all specs in spec directory (excluding plugin specs)"
...
6
7
8
9
 
10
11
12
13
14
15
16
...
17
18
19
20
 
21
22
23
24
 
25
26
 
27
28
29
30
31
32
 
33
34
 
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
...
40
41
42
43
 
44
45
46
47
48
49
 
 
 
 
 
50
51
 
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
71
72
 
73
74
75
 
76
77
 
78
79
 
80
81
 
82
83
84
85
86
87
88
89
90
 
 
 
91
92
93
94
95
96
97
98
99
100
101
102
103
 
 
 
 
 
 
 
 
 
 
104
105
106
107
108
109
110
111
112
113
 
 
 
 
 
 
 
 
 
114
115
 
116
117
 
118
119
120
121
 
122
123
 
124
125
 
126
127
 
128
129
 
130
131
132
133
 
 
 
134
135
136
137
138
139
140
 
 
 
 
141
142
 
143
144
145
146
 
 
 
147
148
 
149
150
151
152
153
 
 
 
 
154
155
 
156
157
158
159
160
161
162
163
164
 
 
 
 
 
 
 
 
165
166
167
...
6
7
8
 
9
10
11
12
13
14
15
16
...
17
18
19
 
20
21
22
23
 
24
25
 
26
27
28
29
30
31
 
32
33
 
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
...
40
41
42
 
43
44
 
 
 
 
 
45
46
47
48
49
50
 
51
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 
72
73
74
 
75
76
 
77
78
 
79
80
 
81
82
83
84
85
86
87
 
 
 
88
89
90
91
92
93
 
 
 
 
 
 
 
 
 
 
94
95
96
97
98
99
100
101
102
103
104
 
 
 
 
 
 
 
 
 
105
106
107
108
109
110
111
112
113
114
 
115
116
 
117
118
119
120
 
121
122
 
123
124
 
125
126
 
127
128
 
129
130
 
 
 
131
132
133
134
135
136
 
 
 
 
137
138
139
140
141
 
142
143
 
 
 
144
145
146
147
 
148
149
 
 
 
 
150
151
152
153
154
 
155
156
 
 
 
 
 
 
 
 
157
158
159
160
161
162
163
164
165
166
167
0
@@ -6,7 +6,7 @@
0
   module Jdbc
0
     class Connection < DataObjects::Connection
0
       include_class 'java.sql.DriverManager'
0
-
0
+
0
       def initialize(uri)
0
         options = Hash[*uri.query.split(/[&=]/)].inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
0
         url = nil
0
0
0
0
0
@@ -17,21 +17,21 @@
0
         else
0
           url = uri.path.dup["/"] = ""
0
         end
0
-
0
+
0
         include_class(options[:driver])
0
         @connection = DriverManager.get_connection("jdbc:#{options[:protocol]}:#{url}", uri.user, uri.password)
0
       end
0
-
0
+
0
       def jdbc_connection
0
- @connection
0
+ @connection
0
       end
0
 
0
       def real_close
0
         @connection.close
0
       end
0
-
0
+
0
       def begin_transaction
0
-
0
+
0
       end
0
     end
0
 
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
@@ -40,128 +40,128 @@
0
       def set_types(types)
0
         @types = types
0
       end
0
-
0
+
0
       def execute_non_query(*args)
0
- sql = @connection.jdbc_connection.create_statement
0
- return nil if (updcount = sql.execute_update(@text)) < 0
0
- key = "TODO"
0
- Result.new(self, updcount, key)
0
- # create a result object with the number of affected rows and the created id, if any
0
+ sql = @connection.jdbc_connection.create_statement
0
+ return nil if (updcount = sql.execute_update(@text)) < 0
0
+ key = "TODO"
0
+ Result.new(self, updcount, key)
0
+ # create a result object with the number of affected rows and the created id, if any
0
       end
0
-
0
+
0
       def execute_reader(*args)
0
- # escape all parameters given and pass them to query
0
- # execute the query
0
- # if no response return nil
0
- # save the field count
0
- # instantiate a new reader
0
- # pass the response to the reader
0
- # mark the reader as opened
0
- # save the field_count in reader
0
- # get the field types
0
- # if no types passed, guess the types
0
- # for each field
0
- # save its name
0
- # guess the type if no types passed
0
- # set the reader @field_names and @types (guessed or otherwise)
0
- # yield the reader if a block is given, then close it
0
- # return the reader
0
-
0
+ # escape all parameters given and pass them to query
0
+ # execute the query
0
+ # if no response return nil
0
+ # save the field count
0
+ # instantiate a new reader
0
+ # pass the response to the reader
0
+ # mark the reader as opened
0
+ # save the field_count in reader
0
+ # get the field types
0
+ # if no types passed, guess the types
0
+ # for each field
0
+ # save its name
0
+ # guess the type if no types passed
0
+ # set the reader @field_names and @types (guessed or otherwise)
0
+ # yield the reader if a block is given, then close it
0
+ # return the reader
0
+
0
         sql = @connection.jdbc_connection.create_statement()
0
 
0
- Reader.new(sql.execute_query(@text), @types)
0
+ Reader.new(sql.execute_query(@text), @types)
0
       end
0
     end
0
-
0
+
0
     class Result < DataObjects::Result
0
-
0
+
0
     end
0
-
0
+
0
     class Transaction < DataObjects::Transaction
0
-
0
+
0
     end
0
 
0
     class Reader < DataObjects::Reader
0
       include_class 'java.sql.Types'
0
 
0
       def initialize(result, types)
0
- @result = result
0
- @meta_data = result.meta_data
0
- @types = types || java_types_to_ruby_types(@meta_data)
0
+ @result = result
0
+ @meta_data = result.meta_data
0
+ @types = types || java_types_to_ruby_types(@meta_data)
0
       end
0
 
0
       def java_types_to_ruby_types(meta_data)
0
- (1 .. meta_data.column_count).map do |i|
0
- case meta_data.column_type(i)
0
- when Types::INTEGER, Types::SMALLINT, Types::TINYINT
0
- Fixnum
0
- when Types::BIGINT
0
- Bignum
0
- when Types::BIT, Types::BOOLEAN
0
- TrueClass
0
- when Types::CHAR, Types::VARCHAR
0
- String
0
+ (1 .. meta_data.column_count).map do |i|
0
+ case meta_data.column_type(i)
0
+ when Types::INTEGER, Types::SMALLINT, Types::TINYINT
0
+ Fixnum
0
+ when Types::BIGINT
0
+ Bignum
0
+ when Types::BIT, Types::BOOLEAN
0
+ TrueClass
0
+ when Types::CHAR, Types::VARCHAR
0
+ String
0
           when Types::DATE
0
- Date
0
- when Types::DECIMAL, Types::NUMERIC
0
- BigDecimal
0
- when Types::FLOAT, Types::DOUBLE
0
- Float
0
- when Types::TIMESTAMP
0
- DateTime
0
- when Types::OTHER
0
- String
0
+ Date
0
+ when Types::DECIMAL, Types::NUMERIC
0
+ BigDecimal
0
+ when Types::FLOAT, Types::DOUBLE
0
+ Float
0
+ when Types::TIMESTAMP
0
+ DateTime
0
+ when Types::OTHER
0
+ String
0
           else
0
- raise "No casting rule for type #{meta_data.column_type(i)} (#{meta_data.column_name(i)}). Please report this."
0
+ raise "No casting rule for type #{meta_data.column_type(i)} (#{meta_data.column_name(i)}). Please report this."
0
           end
0
- end
0
+ end
0
       end
0
 
0
       def close
0
-
0
+
0
       end
0
-
0
+
0
       def next!
0
- @in_row = (@result.next || nil)
0
+ @in_row = (@result.next || nil)
0
       end
0
-
0
+
0
       def values
0
- raise "error" unless @in_row
0
+ raise "error" unless @in_row
0
 
0
- @values = (1 .. @meta_data.column_count).map do |i|
0
- type_cast_value(i - 1, @result.object(i))
0
- end
0
+ @values = (1 .. @meta_data.column_count).map do |i|
0
+ type_cast_value(i - 1, @result.object(i))
0
+ end
0
       end
0
 
0
       def type_cast_value(index, value)
0
- if String == @types[index]
0
- value.to_s
0
- elsif [Fixnum, Bignum].include?(@types[index])
0
- value.to_i
0
+ if String == @types[index]
0
+ value.to_s
0
+ elsif [Integer, Fixnum, Bignum].include?(@types[index])
0
+ value.to_i
0
         elsif BigDecimal == @types[index]
0
- BigDecimal.new(value.to_string)
0
+ BigDecimal.new(value.to_string)
0
         elsif Float == @types[index]
0
- value.to_f
0
- elsif [TrueClass, FalseClass].include?(@types[index])
0
- value
0
+ value.to_f
0
+ elsif [TrueClass, FalseClass].include?(@types[index])
0
+ value
0
         elsif Date == @types[index]
0
- Date.parse(value.to_string)
0
+ Date.parse(value.to_string)
0
         elsif DateTime == @types[index]
0
- DateTime.parse(value.to_string)
0
- else
0
- raise "Oops! Forgot to handle #{@types[index]} (#{value})"
0
- end
0
+ DateTime.parse(value.to_string)
0
+ else
0
+ raise "Oops! Forgot to handle #{@types[index]} (#{value})"
0
+ end
0
       end
0
-
0
+
0
       def fields
0
- @fields ||= begin
0
- ccnt = @meta_data.column_count
0
- fields = []
0
- 1.upto(ccnt) do |i|
0
- fields << @meta_data.column_name(i)
0
- end
0
- fields
0
- end
0
+ @fields ||= begin
0
+ ccnt = @meta_data.column_count
0
+ fields = []
0
+ 1.upto(ccnt) do |i|
0
+ fields << @meta_data.column_name(i)
0
+ end
0
+ fields
0
+ end
0
       end
0
     end
0
   end
...
12
13
14
15
 
16
17
18
19
20
21
22
23
24
...
37
38
39
40
 
41
42
 
43
44
 
45
46
47
48
49
 
 
50
51
52
53
54
 
 
 
 
55
56
57
58
 
59
60
61
62
63
 
 
 
64
65
66
67
68
...
93
94
95
96
 
97
98
99
 
100
101
102
 
103
104
105
...
12
13
14
 
15
16
17
18
19
20
21
22
23
24
...
37
38
39
 
40
41
 
42
43
 
44
45
46
47
 
 
48
49
50
 
 
 
 
51
52
53
54
55
56
57
 
58
59
60
 
 
 
61
62
63
64
65
66
67
68
...
93
94
95
 
96
97
98
 
99
100
101
 
102
103
104
105
0
@@ -12,7 +12,7 @@
0
       DataObjects::Jdbc.const_get('Result').should_not be_nil
0
       DataObjects::Jdbc.const_get('Reader').should_not be_nil
0
     end
0
-
0
+
0
     it "should connect successfully using the full URI" do
0
       DataObjects::Jdbc::Connection.
0
         new(URI.parse("jdbc://postgres:pg123@localhost:5432/do_jdbc_test?driver=org.postgresql.Driver&protocol=postgresql"))
0
0
0
0
0
0
0
@@ -37,30 +37,30 @@
0
 
0
       describe "reading results" do
0
         before(:each) do
0
- @reader = @command.execute_reader
0
+ @reader = @command.execute_reader
0
         end
0
-
0
+
0
         it "should return the proper number of fields" do
0
- @reader.fields.size.should == 18
0
+ @reader.fields.size.should == 18
0
         end
0
 
0
         it "should fetch 2 rows" do
0
- @reader.next!.should == true
0
- @reader.values.should be_kind_of(Array)
0
+ @reader.next!.should == true
0
+ @reader.values.should be_kind_of(Array)
0
 
0
- @reader.next!.should == true
0
- @reader.values.should be_kind_of(Array)
0
-
0
- @reader.next!.should be_nil
0
+ @reader.next!.should == true
0
+ @reader.values.should be_kind_of(Array)
0
+
0
+ @reader.next!.should be_nil
0
         end
0
       end
0
 
0
- describe "executing a query w/ set_types" do
0
+ describe "executing a query w/ set_types" do
0
         before(:all) do
0
           @types = [
0
- Fixnum, String, String, String, String, String,
0
- String, Fixnum, Fixnum, Fixnum, Fixnum, Float, Float,
0
- BigDecimal, Date, DateTime, DateTime, String
0
+ Integer, String, String, String, String, String,
0
+ String, Integer, Integer, Integer, Integer, Float, Float,
0
+ BigDecimal, Date, DateTime, DateTime, String
0
           ]
0
         end
0
 
0
0
0
@@ -93,13 +93,13 @@
0
         result = command.execute_non_query
0
         result.to_i.should == 1
0
       end
0
-
0
+
0
       it "should yield the last inserted id" do
0
         @connection.create_command("TRUNCATE TABLE invoices").execute_non_query
0
-
0
+
0
         result = @connection.create_command("INSERT INTO invoices (invoice_number) VALUES ('1234')").execute_non_query
0
         result.insert_id.should == 1
0
-
0
+
0
         result = @connection.create_command("INSERT INTO invoices (invoice_number) VALUES ('3456')").execute_non_query
0
         result.insert_id.should == 2
0
       end
...
11
12
13
14
 
15
16
17
18
19
20
21
 
22
23
24
25
...
28
29
30
31
 
32
33
34
35
36
 
37
38
39
40
41
42
43
44
45
...
41
42
43
44
 
45
46
47
48
49
 
50
51
52
 
53
54
55
 
56
57
58
 
59
60
61
 
62
63
64
 
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
...
88
89
90
91
 
92
93
94
95
96
97
98
 
99
100
101
102
 
103
104
105
106
107
 
108
109
110
111
 
112
113
114
115
116
 
117
118
119
120
 
121
122
123
 
124
125
126
 
127
128
129
 
130
131
132
133
134
 
135
136
137
138
139
 
140
141
142
143
144
145
 
 
146
147
148
149
 
 
150
151
152
...
160
161
162
163
 
164
165
166
...
169
170
171
172
 
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
185
186
187
188
 
189
190
191
192
193
194
195
 
196
197
198
199
200
201
 
202
203
204
 
205
206
207
 
208
209
210
211
 
212
213
214
215
216
217
218
 
219
220
221
222
 
223
224
225
 
226
227
228
 
229
230
 
231
232
 
233
234
235
236
237
238
239
240
241
...
239
240
241
242
 
243
244
245
 
246
247
248
 
249
250
251
 
252
253
254
255
256
 
 
257
258
259
 
260
261
 
262
...
11
12
13
 
14
15
16
17
18
19
20
 
21
22
23
24
25
...
28
29
30
 
31
32
33
34
35
 
36
37
38
39
40
41
42
43
44
45
...
41
42
43
 
44
45
46
47
48
 
49
50
51
 
52
53
54
 
55
56
57
 
58
59
60
 
61
62
63
 
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
...
88
89
90
 
91
92
93
94
95
96
97
 
98
99
100
101
 
102
103
104
105
106
 
107
108
109
110
 
111
112
113
114
115
 
116
117
118
119
 
120
121
122
 
123
124
125
 
126
127
128
 
129
130
131
132
133
 
134
135
136
137
138
 
139
140
141
142
143
 
 
144
145
146
147
 
 
148
149
150
151
152
...
160
161
162
 
163
164
165
166
...
169
170
171
 
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
185
186
187
 
188
189
190
191
192
193
194
 
195
196
197
198
199
200
 
201
202
203
 
204
205
206
 
207
208
209
210
 
211
212
213
214
215
216
217
 
218
219
220
221
 
222
223
224
 
225
226
227
 
228
229
 
230
231
 
232
233
234
235
236
237
238
239
240
241
...
239
240
241
 
242
243
244
 
245
246
247
 
248
249
250
 
251
252
253
254
 
 
255
256
257
258
 
259
260
 
261
262
0
@@ -11,14 +11,14 @@
0
 SOCKET_PATH = `#{MYSQL_CONFIG_COMMAND} --socket`.strip
0
 
0
 describe DataObjects::Mysql do
0
-
0
+
0
   it "should expose the proper DataObjects classes" do
0
     DataObjects::Mysql.const_get('Connection').should_not be_nil
0
     DataObjects::Mysql.const_get('Command').should_not be_nil
0
     DataObjects::Mysql.const_get('Result').should_not be_nil
0
     DataObjects::Mysql.const_get('Reader').should_not be_nil
0
   end
0
-
0
+
0
   it "should connect successfully via TCP" do
0
     connection = DataObjects::Mysql::Connection.new("mysql://root@127.0.0.1:3306/do_mysql_test")
0
     connection.should_not be_using_socket
0
0
@@ -28,12 +28,12 @@
0
     connection = DataObjects::Mysql::Connection.new("mysql://root@localhost:3306/do_mysql_test/?socket=#{SOCKET_PATH}")
0
     connection.should be_using_socket
0
   end
0
-
0
+
0
   it "should return the current character set" do
0
     connection = DataObjects::Mysql::Connection.new("mysql://root@localhost:3306/do_mysql_test/?socket=#{SOCKET_PATH}")
0
     connection.character_set.should == "utf8"
0
   end
0
-
0
+
0
   it "should support changing the character set" do
0
     connection = DataObjects::Mysql::Connection.new("mysql://root@localhost:3306/do_mysql_test/?socket=#{SOCKET_PATH}&charset=latin1")
0
     connection.character_set.should == "latin1"
0
0
0
0
0
0
0
@@ -41,27 +41,27 @@
0
     connection = DataObjects::Mysql::Connection.new("mysql://root@localhost:3306/do_mysql_test/?socket=#{SOCKET_PATH}&charset=utf8")
0
     connection.character_set.should == "utf8"
0
   end
0
-
0
+
0
   it "should raise an error when opened with an invalid server uri" do
0
     def connecting_with(uri)
0
       lambda { DataObjects::Mysql::Connection.new(uri) }
0
     end
0
-
0
+
0
     # Missing database name
0
     connecting_with("mysql://root@localhost:3306/").should raise_error(MysqlError)
0
-
0
+
0
     # Wrong port
0
     connecting_with("mysql://root@localhost:666/").should raise_error(MysqlError)
0
-
0
+
0
     # Bad Username
0
     connecting_with("mysql://baduser@localhost:3306/").should raise_error(MysqlError)
0
-
0
+
0
     # Bad Password
0
     connecting_with("mysql://root:wrongpassword@localhost:3306/").should raise_error(MysqlError)
0
-
0
+
0
     # Bad Database Name
0
     connecting_with("mysql://root@localhost:3306/bad_database").should raise_error(MysqlError)
0
-
0
+
0
     # Invalid Socket Path
0
     connecting_with("mysql://root@localhost:3306/do_mysql_test/?socket=/invalid/path/mysql.sock").should raise_error(MysqlError)
0
   end
0
0
0
0
0
0
0
0
0
0
0
0
0
0
@@ -88,65 +88,65 @@
0
     before(:each) do
0
       @command = @connection.create_command("SELECT * FROM widgets LIMIT 2")
0
     end
0
-
0
+
0
     it "should escape strings properly" do
0
       command = @connection.create_command("SELECT * FROM widgets WHERE name = ?")
0
       command.quote_string("Willy