Skip to content

Commit 1a3773a

Browse files
committed
Ensure test database data is loaded before running tests
1 parent 62fd9cd commit 1a3773a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/client_test.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
require 'test_helper'
33

44
class ClientTest < TinyTds::TestCase
5+
before do
6+
@@current_schema_loaded ||= load_current_schema
7+
end
8+
59
describe 'with valid credentials' do
610
before do
711
@client = new_connection
@@ -327,7 +331,7 @@ class ClientTest < TinyTds::TestCase
327331
it 'has a #do method that cancels result rows and returns affected rows natively' do
328332
rollback_transaction(@client) do
329333
text = 'test affected rows native'
330-
count = @client.execute("SELECT COUNT(*) AS [count] FROM [datatypes]").each.first['count']
334+
count = @client.execute("SELECT COUNT(*) AS [count] FROM [datatypes]").first['count']
331335
deleted_rows = @client.do("DELETE FROM [datatypes]")
332336
assert_equal count, deleted_rows, 'should have deleted rows equal to count'
333337
inserted_rows = @client.do("INSERT INTO [datatypes] ([varchar_50]) VALUES ('#{text}')")

0 commit comments

Comments
 (0)