tiny_tds 2.1.2-x64-mingw32 → 2.1.5-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +5 -4
  3. data/CHANGELOG.md +20 -1
  4. data/README.md +31 -18
  5. data/VERSION +1 -1
  6. data/appveyor.yml +28 -7
  7. data/docker-compose.yml +22 -0
  8. data/ext/tiny_tds/client.c +90 -44
  9. data/ext/tiny_tds/client.h +5 -3
  10. data/ext/tiny_tds/extconf.rb +17 -13
  11. data/ext/tiny_tds/extconsts.rb +2 -2
  12. data/ext/tiny_tds/result.c +24 -10
  13. data/lib/tiny_tds/2.4/tiny_tds.so +0 -0
  14. data/lib/tiny_tds/2.5/tiny_tds.so +0 -0
  15. data/lib/tiny_tds/2.6/tiny_tds.so +0 -0
  16. data/lib/tiny_tds/2.7/tiny_tds.so +0 -0
  17. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/bin/bsqldb.exe +0 -0
  18. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/bin/datacopy.exe +0 -0
  19. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/bin/defncopy.exe +0 -0
  20. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/bin/freebcp.exe +0 -0
  21. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/libct-4.dll +0 -0
  22. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/libsybdb-5.dll +0 -0
  23. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/bin/osql +0 -0
  24. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/tdspool.exe +0 -0
  25. data/ports/x86_64-w64-mingw32/freetds/1.1.24/bin/tsql.exe +0 -0
  26. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/lib/libct.dll.a +0 -0
  27. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/lib/libct.la +2 -2
  28. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/lib/libsybdb.dll.a +0 -0
  29. data/ports/x86_64-w64-mingw32/freetds/{1.00.27 → 1.1.24}/lib/libsybdb.la +2 -2
  30. data/ports/x86_64-w64-mingw32/libiconv/1.15/bin/iconv.exe +0 -0
  31. data/ports/x86_64-w64-mingw32/libiconv/1.15/bin/libcharset-1.dll +0 -0
  32. data/ports/x86_64-w64-mingw32/libiconv/1.15/bin/libiconv-2.dll +0 -0
  33. data/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libcharset.dll.a +0 -0
  34. data/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libcharset.la +2 -2
  35. data/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libiconv.dll.a +0 -0
  36. data/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libiconv.la +2 -2
  37. data/ports/x86_64-w64-mingw32/openssl/{1.1.0e → 1.1.1d}/bin/c_rehash +3 -3
  38. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/bin/libcrypto-1_1-x64.dll +0 -0
  39. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/bin/libssl-1_1-x64.dll +0 -0
  40. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/bin/openssl.exe +0 -0
  41. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib/libcrypto.a +0 -0
  42. data/ports/x86_64-w64-mingw32/openssl/{1.1.0e → 1.1.1d}/lib/libcrypto.dll.a +0 -0
  43. data/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib/libssl.a +0 -0
  44. data/ports/x86_64-w64-mingw32/openssl/{1.1.0e → 1.1.1d}/lib/libssl.dll.a +0 -0
  45. data/tasks/native_gem.rake +1 -1
  46. data/tasks/ports/openssl.rb +2 -18
  47. data/tasks/ports.rake +5 -7
  48. data/test/client_test.rb +99 -54
  49. data/test/gem_test.rb +15 -15
  50. data/test/result_test.rb +83 -42
  51. data/test/schema_test.rb +12 -12
  52. data/test/test_helper.rb +58 -4
  53. data/test/thread_test.rb +1 -1
  54. data/tiny_tds.gemspec +3 -2
  55. metadata +47 -36
  56. data/BACKERS.md +0 -32
  57. data/lib/tiny_tds/2.0/tiny_tds.so +0 -0
  58. data/lib/tiny_tds/2.1/tiny_tds.so +0 -0
  59. data/lib/tiny_tds/2.2/tiny_tds.so +0 -0
  60. data/lib/tiny_tds/2.3/tiny_tds.so +0 -0
  61. data/ports/x86_64-w64-mingw32/freetds/1.00.27/bin/libct-4.dll +0 -0
  62. data/ports/x86_64-w64-mingw32/freetds/1.00.27/bin/libsybdb-5.dll +0 -0
  63. data/ports/x86_64-w64-mingw32/freetds/1.00.27/bin/tdspool.exe +0 -0
  64. data/ports/x86_64-w64-mingw32/freetds/1.00.27/bin/tsql.exe +0 -0
  65. data/ports/x86_64-w64-mingw32/openssl/1.1.0e/bin/libcrypto-1_1-x64.dll +0 -0
  66. data/ports/x86_64-w64-mingw32/openssl/1.1.0e/bin/libssl-1_1-x64.dll +0 -0
  67. data/ports/x86_64-w64-mingw32/openssl/1.1.0e/bin/openssl.exe +0 -0
  68. data/ports/x86_64-w64-mingw32/openssl/1.1.0e/lib/libcrypto.a +0 -0
  69. data/ports/x86_64-w64-mingw32/openssl/1.1.0e/lib/libssl.a +0 -0
@@ -17,7 +17,7 @@ old_library=''
17
17
  inherited_linker_flags=''
18
18
 
19
19
  # Libraries that this one depends upon.
20
- dependency_libs=' -R/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.0e/lib -lws2_32 -lssl -lcrypto /Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libiconv.la'
20
+ dependency_libs=' -R/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib -lws2_32 -lssl -lcrypto /Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libiconv.la'
21
21
 
22
22
  # Names of additional weak libraries provided by this library
23
23
  weak_library_names=''
@@ -38,4 +38,4 @@ dlopen=''
38
38
  dlpreopen=''
39
39
 
40
40
  # Directory that this library needs to be installed in:
41
- libdir='/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/freetds/1.00.27/lib'
41
+ libdir='/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/freetds/1.1.24/lib'
@@ -17,7 +17,7 @@ old_library=''
17
17
  inherited_linker_flags=''
18
18
 
19
19
  # Libraries that this one depends upon.
20
- dependency_libs=' -R/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.0e/lib -lws2_32 -lssl -lcrypto /Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libiconv.la'
20
+ dependency_libs=' -R/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib -L/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib -lws2_32 -lssl -lcrypto /Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib/libiconv.la'
21
21
 
22
22
  # Names of additional weak libraries provided by this library
23
23
  weak_library_names=''
@@ -38,4 +38,4 @@ dlopen=''
38
38
  dlpreopen=''
39
39
 
40
40
  # Directory that this library needs to be installed in:
41
- libdir='/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/freetds/1.00.27/lib'
41
+ libdir='/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/freetds/1.1.24/lib'
@@ -17,7 +17,7 @@ old_library=''
17
17
  inherited_linker_flags=''
18
18
 
19
19
  # Libraries that this one depends upon.
20
- dependency_libs=' -L/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.0e/lib'
20
+ dependency_libs=' -L/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib'
21
21
 
22
22
  # Names of additional weak libraries provided by this library
23
23
  weak_library_names=''
@@ -38,4 +38,4 @@ dlopen=''
38
38
  dlpreopen=''
39
39
 
40
40
  # Directory that this library needs to be installed in:
41
- libdir='/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib'
41
+ libdir='/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib'
@@ -17,7 +17,7 @@ old_library=''
17
17
  inherited_linker_flags=''
18
18
 
19
19
  # Libraries that this one depends upon.
20
- dependency_libs=' -L/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.0e/lib'
20
+ dependency_libs=' -L/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.1d/lib'
21
21
 
22
22
  # Names of additional weak libraries provided by this library
23
23
  weak_library_names=''
@@ -38,4 +38,4 @@ dlopen=''
38
38
  dlpreopen=''
39
39
 
40
40
  # Directory that this library needs to be installed in:
41
- libdir='/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib'
41
+ libdir='/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/libiconv/1.15/lib'
@@ -2,7 +2,7 @@
2
2
 
3
3
  # WARNING: do not edit!
4
4
  # Generated by Makefile from tools/c_rehash.in
5
- # Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
5
+ # Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
6
6
  #
7
7
  # Licensed under the OpenSSL license (the "License"). You may not use
8
8
  # this file except in compliance with the License. You can obtain a copy
@@ -12,8 +12,8 @@
12
12
  # Perl c_rehash script, scan all files in a directory
13
13
  # and add symbolic links to their hash values.
14
14
 
15
- my $dir = "";
16
- my $prefix = "/Users/kencollins/Repositories/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.0e";
15
+ my $dir = "/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.1d";
16
+ my $prefix = "/Users/bvogelzang/Documents/tiny_tds/ports/x86_64-w64-mingw32/openssl/1.1.1d";
17
17
 
18
18
  my $errorcount = 0;
19
19
  my $openssl = $ENV{OPENSSL} || "openssl";
@@ -8,7 +8,7 @@ task 'gem:windows' => ['ports:cross'] do
8
8
  build = ['bundle']
9
9
 
10
10
  # and finally build the native gem
11
- build << 'rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0 CFLAGS="-Wall" MAKE="make -j`nproc`"'
11
+ build << 'rake cross native gem RUBY_CC_VERSION=2.7.0:2.6.0:2.5.0:2.4.0 CFLAGS="-Wall" MAKE="make -j`nproc`"'
12
12
 
13
13
  RakeCompilerDock.sh build.join(' && ')
14
14
  end
@@ -27,27 +27,11 @@ module Ports
27
27
 
28
28
  private
29
29
 
30
- def execute(action, command, options={})
31
- # OpenSSL Requires Perl >= 5.10, while the Ruby devkit uses MSYS1 with Perl 5.8.8.
32
- # To overcome this, prepend Git's usr/bin to the PATH.
33
- # It has MSYS2 with a recent version of perl.
34
- prev_path = ENV['PATH']
35
- if host =~ /mingw/ && IO.popen(["perl", "-e", "print($])"], &:read).to_f < 5.010
36
- git_perl = 'C:/Program Files/Git/usr/bin'
37
- if File.directory?(git_perl)
38
- ENV['PATH'] = "#{git_perl}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
39
- ENV['PERL'] = 'perl'
40
- end
41
- end
42
-
43
- super
44
- ENV['PATH'] = prev_path
45
- end
46
-
47
30
  def configure_defaults
48
31
  opts = [
49
32
  'shared',
50
- target_arch
33
+ target_arch,
34
+ "--openssldir=#{path}",
51
35
  ]
52
36
 
53
37
  if cross_build?
data/tasks/ports.rake CHANGED
@@ -6,14 +6,14 @@ require_relative 'ports/openssl'
6
6
  require_relative 'ports/freetds'
7
7
  require_relative '../ext/tiny_tds/extconsts'
8
8
 
9
- OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if defined? OpenSSL
10
-
11
9
  namespace :ports do
12
10
  openssl = Ports::Openssl.new(OPENSSL_VERSION)
13
11
  libiconv = Ports::Libiconv.new(ICONV_VERSION)
14
12
  freetds = Ports::Freetds.new(FREETDS_VERSION)
15
13
 
16
14
  directory "ports"
15
+ CLEAN.include "ports/*mingw32*"
16
+ CLEAN.include "ports/*.installed"
17
17
 
18
18
  task :openssl, [:host] do |task, args|
19
19
  args.with_defaults(host: RbConfig::CONFIG['host'])
@@ -71,15 +71,13 @@ namespace :ports do
71
71
  task 'cross' do
72
72
  require 'rake_compiler_dock'
73
73
 
74
- # make sure to install our bundle
75
- build = ['bundle']
76
-
77
74
  # build the ports for all our cross compile hosts
78
75
  GEM_PLATFORM_HOSTS.each do |gem_platform, host|
76
+ # make sure to install our bundle
77
+ build = ['bundle']
79
78
  build << "rake ports:compile[#{host}] MAKE='make -j`nproc`'"
79
+ RakeCompilerDock.sh build.join(' && '), platform: gem_platform
80
80
  end
81
-
82
- RakeCompilerDock.sh build.join(' && ')
83
81
  end
84
82
  end
85
83
 
data/test/client_test.rb CHANGED
@@ -2,9 +2,7 @@
2
2
  require 'test_helper'
3
3
 
4
4
  class ClientTest < TinyTds::TestCase
5
-
6
- describe 'With valid credentials' do
7
-
5
+ describe 'with valid credentials' do
8
6
  before do
9
7
  @client = new_connection
10
8
  end
@@ -67,10 +65,12 @@ class ClientTest < TinyTds::TestCase
67
65
  client.close if client
68
66
  end
69
67
  end unless sqlserver_azure?
70
-
71
68
  end
72
69
 
73
70
  describe 'With in-valid options' do
71
+ before(:all) do
72
+ init_toxiproxy
73
+ end
74
74
 
75
75
  it 'raises an argument error when no :host given and :dataserver is blank' do
76
76
  assert_raises(ArgumentError) { new_connection :dataserver => nil, :host => nil }
@@ -132,30 +132,64 @@ class ClientTest < TinyTds::TestCase
132
132
  end
133
133
  end
134
134
 
135
- it 'must run this test to prove we account for dropped connections' do
136
- skip
135
+ it 'raises TinyTds exception with tcp socket network failure' do
136
+ skip if ENV['CI'] && ENV['APPVEYOR_BUILD_FOLDER'] # only CI using docker
137
137
  begin
138
- client = new_connection :login_timeout => 2, :timeout => 2
138
+ client = new_connection timeout: 2, port: 1234
139
139
  assert_client_works(client)
140
- STDOUT.puts "Disconnect network!"
141
- sleep 10
142
- STDOUT.puts "This should not get stuck past 6 seconds!"
143
- action = lambda { client.execute('SELECT 1 as [one]').each }
140
+ action = lambda { client.execute("waitfor delay '00:00:05'").do }
141
+
142
+ # Use toxiproxy to close the TCP socket after 1 second.
143
+ # We want TinyTds to execute the statement, hit the timeout configured above, and then not be able to use the network to cancel
144
+ # the network connection needs to close after the sql batch is sent and before the timeout above is hit
145
+ Toxiproxy[:sqlserver_test].toxic(:slow_close, delay: 1000).apply do
146
+ assert_raise_tinytds_error(action) do |e|
147
+ assert_equal 20003, e.db_error_number
148
+ assert_equal 6, e.severity
149
+ assert_match %r{timed out}i, e.message, 'ignore if non-english test run'
150
+ end
151
+ end
152
+ ensure
153
+ assert_new_connections_work
154
+ end
155
+ end
156
+
157
+ it 'raises TinyTds exception with dead connection network failure' do
158
+ skip if ENV['CI'] && ENV['APPVEYOR_BUILD_FOLDER'] # only CI using docker
159
+ begin
160
+ client = new_connection timeout: 2, port: 1234
161
+ assert_client_works(client)
162
+ action = lambda { client.execute("waitfor delay '00:00:05'").do }
163
+
164
+ # Use toxiproxy to close the network connection after 1 second.
165
+ # We want TinyTds to execute the statement, hit the timeout configured above, and then not be able to use the network to cancel
166
+ # the network connection needs to close after the sql batch is sent and before the timeout above is hit
167
+ Toxiproxy[:sqlserver_test].toxic(:timeout, timeout: 1000).apply do
168
+ assert_raise_tinytds_error(action) do |e|
169
+ assert_equal 20047, e.db_error_number
170
+ assert_includes [1,9], e.severity
171
+ assert_match %r{dead or not enabled}i, e.message, 'ignore if non-english test run'
172
+ end
173
+ end
174
+ ensure
175
+ assert_new_connections_work
176
+ end
177
+ end
178
+
179
+ it 'raises TinyTds exception with login timeout' do
180
+ skip if ENV['CI'] && ENV['APPVEYOR_BUILD_FOLDER'] # only CI using docker
181
+ begin
182
+ action = lambda do
183
+ Toxiproxy[:sqlserver_test].toxic(:timeout, timeout: 0).apply do
184
+ new_connection login_timeout: 1, port: 1234
185
+ end
186
+ end
144
187
  assert_raise_tinytds_error(action) do |e|
145
188
  assert_equal 20003, e.db_error_number
146
189
  assert_equal 6, e.severity
147
190
  assert_match %r{timed out}i, e.message, 'ignore if non-english test run'
148
191
  end
149
192
  ensure
150
- STDOUT.puts "Reconnect network!"
151
- sleep 10
152
- action = lambda { client.execute('SELECT 1 as [one]').each }
153
- assert_raise_tinytds_error(action) do |e|
154
- assert_equal 20047, e.db_error_number
155
- assert_equal 1, e.severity
156
- assert_match %r{dead or not enabled}i, e.message, 'ignore if non-english test run'
157
- end
158
- close_client(client)
159
193
  assert_new_connections_work
160
194
  end
161
195
  end
@@ -174,57 +208,68 @@ class ClientTest < TinyTds::TestCase
174
208
 
175
209
  end
176
210
 
177
- describe 'Private methods' do
178
-
211
+ describe '#parse_username' do
179
212
  let(:client) { @client = new_connection }
180
213
 
181
- it '#parse_username returns username if azure is not true' do
182
- username = 'user@abc123.database.windows.net'
183
- client.send(:parse_username, username: username).must_equal username
214
+ it 'returns username if azure is not true' do
215
+ _(
216
+ client.send(:parse_username, username: 'user@abc123.database.windows.net')
217
+ ).must_equal 'user@abc123.database.windows.net'
184
218
  end
185
219
 
186
- it '#parse_username returns short username if azure is true' do
187
- client.send(:parse_username,
188
- username: 'user@abc123.database.windows.net',
189
- host: 'abc123.database.windows.net',
190
- azure: true
220
+ it 'returns short username if azure is true' do
221
+ _(
222
+ client.send(
223
+ :parse_username,
224
+ username: 'user@abc123.database.windows.net',
225
+ host: 'abc123.database.windows.net',
226
+ azure: true
227
+ )
191
228
  ).must_equal 'user@abc123'
192
229
  end
193
230
 
194
- it '#parse_username returns full username if azure is false' do
195
- client.send(:parse_username,
196
- username: 'user@abc123.database.windows.net',
197
- host: 'abc123.database.windows.net',
198
- azure: false
231
+ it 'returns full username if azure is false' do
232
+ _(
233
+ client.send(
234
+ :parse_username,
235
+ username: 'user@abc123.database.windows.net',
236
+ host: 'abc123.database.windows.net',
237
+ azure: false
238
+ )
199
239
  ).must_equal 'user@abc123.database.windows.net'
200
240
  end
201
241
 
202
- it '#parse_username returns short username if passed and azure is true' do
203
- client.send(:parse_username,
204
- username: 'user@abc123',
205
- host: 'abc123.database.windows.net',
206
- azure: true
242
+ it 'returns short username if passed and azure is true' do
243
+ _(
244
+ client.send(
245
+ :parse_username,
246
+ username: 'user@abc123',
247
+ host: 'abc123.database.windows.net',
248
+ azure: true
249
+ )
207
250
  ).must_equal 'user@abc123'
208
251
  end
209
252
 
210
- it '#parse_username returns username with servername if passed and azure is true' do
211
- client.send(:parse_username,
212
- username: 'user',
213
- host: 'abc123.database.windows.net',
214
- azure: true
253
+ it 'returns username with servername if passed and azure is true' do
254
+ _(
255
+ client.send(
256
+ :parse_username,
257
+ username: 'user',
258
+ host: 'abc123.database.windows.net',
259
+ azure: true
260
+ )
215
261
  ).must_equal 'user@abc123'
216
262
  end
217
263
 
218
- it '#parse_username returns username with servername if passed and azure is false' do
219
- client.send(:parse_username,
220
- username: 'user',
221
- host: 'abc123.database.windows.net',
222
- azure: false
264
+ it 'returns username with servername if passed and azure is false' do
265
+ _(
266
+ client.send(
267
+ :parse_username,
268
+ username: 'user',
269
+ host: 'abc123.database.windows.net',
270
+ azure: false
271
+ )
223
272
  ).must_equal 'user'
224
273
  end
225
-
226
274
  end
227
-
228
-
229
275
  end
230
-
data/test/gem_test.rb CHANGED
@@ -21,13 +21,13 @@ class GemTest < MiniTest::Spec
21
21
  let(:root_path) { TinyTds::Gem.root_path }
22
22
 
23
23
  it 'should be the root path' do
24
- root_path.must_equal gem_root
24
+ _(root_path).must_equal gem_root
25
25
  end
26
26
 
27
27
  it 'should be the root path no matter the cwd' do
28
28
  Dir.chdir '/'
29
29
 
30
- root_path.must_equal gem_root
30
+ _(root_path).must_equal gem_root
31
31
  end
32
32
  end
33
33
 
@@ -35,19 +35,19 @@ class GemTest < MiniTest::Spec
35
35
  let(:ports_root_path) { TinyTds::Gem.ports_root_path }
36
36
 
37
37
  it 'should be the ports path' do
38
- ports_root_path.must_equal File.join(gem_root,'ports')
38
+ _(ports_root_path).must_equal File.join(gem_root,'ports')
39
39
  end
40
40
 
41
41
  it 'should be the ports path no matter the cwd' do
42
42
  Dir.chdir '/'
43
43
 
44
- ports_root_path.must_equal File.join(gem_root,'ports')
44
+ _(ports_root_path).must_equal File.join(gem_root,'ports')
45
45
  end
46
46
  end
47
47
 
48
48
  describe '#ports_bin_paths' do
49
49
  let(:ports_bin_paths) { TinyTds::Gem.ports_bin_paths }
50
-
50
+
51
51
  describe 'when the ports directories exist' do
52
52
  let(:fake_bin_paths) do
53
53
  ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
@@ -74,12 +74,12 @@ class GemTest < MiniTest::Spec
74
74
  end
75
75
 
76
76
  it 'should return all the bin directories' do
77
- ports_bin_paths.sort.must_equal fake_bin_paths.sort
77
+ _(ports_bin_paths.sort).must_equal fake_bin_paths.sort
78
78
  end
79
79
 
80
80
  it 'should return all the bin directories regardless of cwd' do
81
81
  Dir.chdir '/'
82
- ports_bin_paths.sort.must_equal fake_bin_paths.sort
82
+ _(ports_bin_paths.sort).must_equal fake_bin_paths.sort
83
83
  end
84
84
  end
85
85
 
@@ -89,19 +89,19 @@ class GemTest < MiniTest::Spec
89
89
  end
90
90
 
91
91
  it 'should return no directories' do
92
- ports_bin_paths.must_be_empty
92
+ _(ports_bin_paths).must_be_empty
93
93
  end
94
94
 
95
95
  it 'should return no directories regardless of cwd' do
96
96
  Dir.chdir '/'
97
- ports_bin_paths.must_be_empty
97
+ _(ports_bin_paths).must_be_empty
98
98
  end
99
99
  end
100
100
  end
101
101
 
102
102
  describe '#ports_lib_paths' do
103
103
  let(:ports_lib_paths) { TinyTds::Gem.ports_lib_paths }
104
-
104
+
105
105
  describe 'when the ports directories exist' do
106
106
  let(:fake_lib_paths) do
107
107
  ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
@@ -128,12 +128,12 @@ class GemTest < MiniTest::Spec
128
128
  end
129
129
 
130
130
  it 'should return all the lib directories' do
131
- ports_lib_paths.sort.must_equal fake_lib_paths.sort
131
+ _(ports_lib_paths.sort).must_equal fake_lib_paths.sort
132
132
  end
133
133
 
134
134
  it 'should return all the lib directories regardless of cwd' do
135
135
  Dir.chdir '/'
136
- ports_lib_paths.sort.must_equal fake_lib_paths.sort
136
+ _(ports_lib_paths.sort).must_equal fake_lib_paths.sort
137
137
  end
138
138
  end
139
139
 
@@ -144,12 +144,12 @@ class GemTest < MiniTest::Spec
144
144
 
145
145
 
146
146
  it 'should return no directories' do
147
- ports_lib_paths.must_be_empty
147
+ _(ports_lib_paths).must_be_empty
148
148
  end
149
149
 
150
150
  it 'should return no directories regardless of cwd' do
151
151
  Dir.chdir '/'
152
- ports_lib_paths.must_be_empty
152
+ _(ports_lib_paths).must_be_empty
153
153
  end
154
154
  end
155
155
  end
@@ -169,7 +169,7 @@ class GemTest < MiniTest::Spec
169
169
  end
170
170
 
171
171
  it "should return a #{expected} ports host" do
172
- TinyTds::Gem.ports_host.must_equal expected
172
+ _(TinyTds::Gem.ports_host).must_equal expected
173
173
  end
174
174
  end
175
175
  end