tiny_tds 0.9.5.beta.11-x64-mingw32 → 0.9.5.beta.12-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a17a17755e29d321e691f6d4edc98257b2769937
4
- data.tar.gz: 910b2a8a98e0993430639f9d0def4046a18e02a4
3
+ metadata.gz: b86cd3a6dabce5be3b2119522a04f5c56d22aa41
4
+ data.tar.gz: 1f03fb522526cefe9150a4d83949b0653f022b8b
5
5
  SHA512:
6
- metadata.gz: bd9460d5aea68a6d22606ad67eea2ca315ae8280a410b8ce771bd6779c12892231c0a60e8615e0fedc4ad97a56e4c896b70d950db30faafacd69b1f50579c4ef
7
- data.tar.gz: 45612a92b0ab4479c08b3ff8b195d5828704a78d714bfb9f103607936f7eeb8a37aa57874600a725cd30c4692af9dd6c9e2cc6b3d9f7c783324307477ade7b4c
6
+ metadata.gz: dff97f80fdf43f165fb32c2fb7cf72b00d58b5b9fbbde43a338bad5e28004ab6f1210725dabee3e96e30bc0cf0cc6fd7de6b819eac23204e02d6d1324286be8b
7
+ data.tar.gz: 148c9502a58c40fb881f694119b8edd1eac9e49cde8ed84f23caa644dddc8c2fd24ca8bcd3be6eaaaa2d5613d8460d6cf2b17b6f969d6d1507ba109ed45cc78a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5.beta.11
1
+ 0.9.5.beta.12
data/appveyor.yml CHANGED
@@ -40,11 +40,11 @@ test_script:
40
40
  - bundle exec rake TINYTDS_UNIT_HOST_TEST=%CI_AZURE_HOST% TINYTDS_UNIT_HOST=%CI_AZURE_HOST% TINYTDS_SCHEMA=sqlserver_azure TDSVER=7.3
41
41
  environment:
42
42
  CI_AZURE_HOST:
43
- secure: b7kG0e0O6hPi/7niF3YTGih1WtdO/dmuyg0k+Le+zEE=
43
+ secure: Qkf6IJGISn6/WK9Feu71wLLQx7g0RMNfjj/YwNE+zJE=
44
44
  TINYTDS_UNIT_AZURE_USER:
45
- secure: Clk9RCYMZ0vz0IfMMnOtJW/ufcCKW3nQC3BgCipdM+c=
45
+ secure: a/9Rph59mNJMObcpJ7mrimqZ+pOth8NLY9iiroFUob4=
46
46
  TINYTDS_UNIT_AZURE_PASS:
47
- secure: D3vsNNzv/Th+RqMNrm3WJw==
47
+ secure: fYKSKV4v+36OFQp2nZdX4DfUpgmy5cm0wuR73cgdmEk=
48
48
  matrix:
49
49
  - ruby_version: "200"
50
50
  - ruby_version: "22"
@@ -64,9 +64,12 @@ module TinyTds
64
64
  end
65
65
 
66
66
  def parse_username(opts)
67
+ host = opts[:host]
67
68
  username = opts[:username]
68
- return username if username.nil? || !opts[:azure] || !username.include?("@")
69
+ return username if username.nil? || !opts[:azure]
70
+ return username if username.include?("@") && !username.include?("database.windows.net")
69
71
  user, domain = username.split("@")
72
+ domain ||= host
70
73
  "#{user}@#{domain.split('.').first}"
71
74
  end
72
75
 
data/test/client_test.rb CHANGED
@@ -151,15 +151,9 @@ class ClientTest < TinyTds::TestCase
151
151
  options = connection_options :username => 'willnotwork'
152
152
  action = lambda { new_connection(options) }
153
153
  assert_raise_tinytds_error(action) do |e|
154
- if sqlserver_azure?
155
- assert_equal 40532, e.db_error_number
156
- assert_equal 20, e.severity
157
- assert_match %r{login failed}i, e.message, 'ignore if non-english test run'
158
- else
159
- assert_equal sybase_ase? ? 4002 : 18456, e.db_error_number
160
- assert_equal 14, e.severity
161
- assert_match %r{login failed}i, e.message, 'ignore if non-english test run'
162
- end
154
+ assert_equal sybase_ase? ? 4002 : 18456, e.db_error_number
155
+ assert_equal 14, e.severity
156
+ assert_match %r{login failed}i, e.message, 'ignore if non-english test run'
163
157
  end
164
158
  assert_new_connections_work
165
159
  end
@@ -171,18 +165,48 @@ class ClientTest < TinyTds::TestCase
171
165
  let(:client) { @client = new_connection }
172
166
 
173
167
  it '#parse_username returns username if azure is not true' do
174
- username = 'user@long.domain.name.com'
168
+ username = 'user@abc123.database.windows.net'
175
169
  client.send(:parse_username, username: username).must_equal username
176
170
  end
177
171
 
178
172
  it '#parse_username returns short username if azure is true' do
179
- username = 'user@long.domain.name.com'
180
- client.send(:parse_username, username: username, azure: true).must_equal 'user@long'
173
+ client.send(:parse_username,
174
+ username: 'user@abc123.database.windows.net',
175
+ host: 'abc123.database.windows.net',
176
+ azure: true
177
+ ).must_equal 'user@abc123'
178
+ end
179
+
180
+ it '#parse_username returns full username if azure is false' do
181
+ client.send(:parse_username,
182
+ username: 'user@abc123.database.windows.net',
183
+ host: 'abc123.database.windows.net',
184
+ azure: false
185
+ ).must_equal 'user@abc123.database.windows.net'
181
186
  end
182
187
 
183
188
  it '#parse_username returns short username if passed and azure is true' do
184
- username = 'user@short'
185
- client.send(:parse_username, username: username, azure: true).must_equal 'user@short'
189
+ client.send(:parse_username,
190
+ username: 'user@abc123',
191
+ host: 'abc123.database.windows.net',
192
+ azure: true
193
+ ).must_equal 'user@abc123'
194
+ end
195
+
196
+ it '#parse_username returns username with servername if passed and azure is true' do
197
+ client.send(:parse_username,
198
+ username: 'user',
199
+ host: 'abc123.database.windows.net',
200
+ azure: true
201
+ ).must_equal 'user@abc123'
202
+ end
203
+
204
+ it '#parse_username returns username with servername if passed and azure is false' do
205
+ client.send(:parse_username,
206
+ username: 'user',
207
+ host: 'abc123.database.windows.net',
208
+ azure: false
209
+ ).must_equal 'user'
186
210
  end
187
211
 
188
212
  end
data/test/thread_test.rb CHANGED
@@ -41,6 +41,7 @@ class ThreadTest < TinyTds::TestCase
41
41
  end
42
42
 
43
43
  it 'should not crash on error in parallel' do
44
+ skip if sqlserver_azure?
44
45
  threads = []
45
46
  @numthreads.times do |i|
46
47
  threads << Thread.new do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_tds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5.beta.11
4
+ version: 0.9.5.beta.12
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Ken Collins
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-16 00:00:00.000000000 Z
13
+ date: 2016-01-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mini_portile2