Skip to content

Fix test warnings #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
safe to call Result#cancel over and over again.
* Look for the syb headers only.
* Fix minitest global matchers warnings.
* Fix test warnings.


## 0.3.2
Expand Down
1 change: 0 additions & 1 deletion test/client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class ClientTest < TinyTds::TestCase
client.close if client
end
end unless sqlserver_azure?

end

describe 'With in-valid options' do
Expand Down
2 changes: 1 addition & 1 deletion test/result_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ class ResultTest < TinyTds::TestCase
end

it 'throws an error when you execute another query with other results pending' do
result1 = @client.execute(@query1)
@client.execute(@query1)
action = lambda { @client.execute(@query1) }
assert_raise_tinytds_error(action) do |e|
assert_match %r|with results pending|i, e.message
Expand Down
24 changes: 12 additions & 12 deletions test/schema_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SchemaTest < TinyTds::TestCase
describe 'for shared types' do

it 'casts bigint' do
assert_equal -9223372036854775807, find_value(11, :bigint)
assert_equal (-9223372036854775807), find_value(11, :bigint)
assert_equal 9223372036854775806, find_value(12, :bigint)
end

Expand Down Expand Up @@ -96,7 +96,7 @@ class SchemaTest < TinyTds::TestCase
end

it 'casts int' do
assert_equal -2147483647, find_value(151, :int)
assert_equal (-2147483647), find_value(151, :int)
assert_equal 2147483646, find_value(152, :int)
end

Expand Down Expand Up @@ -170,7 +170,7 @@ class SchemaTest < TinyTds::TestCase
end

it 'casts smallint' do
assert_equal -32767, find_value(241, :smallint)
assert_equal (-32767), find_value(241, :smallint)
assert_equal 32766, find_value(242, :smallint)
end

Expand Down Expand Up @@ -396,15 +396,15 @@ class SchemaTest < TinyTds::TestCase
if @client.tds_73?
assertions = lambda {
assert_instance_of Time, v
assert_equal 1984, v.year, 'Year'
assert_equal 1, v.month, 'Month'
assert_equal 24, v.day, 'Day'
assert_equal 4, v.hour, 'Hour'
assert_equal 20, v.min, 'Minute'
assert_equal 59, v.sec, 'Second'
assert_equal 123456, v.usec, 'Microseconds'
assert_equal 123456700, v.nsec, 'Nanoseconds'
assert_equal -28800, v.utc_offset, 'Offset'
assert_equal 1984, v.year, 'Year'
assert_equal 1, v.month, 'Month'
assert_equal 24, v.day, 'Day'
assert_equal 4, v.hour, 'Hour'
assert_equal 20, v.min, 'Minute'
assert_equal 59, v.sec, 'Second'
assert_equal 123456, v.usec, 'Microseconds'
assert_equal 123456700, v.nsec, 'Nanoseconds'
assert_equal (-28800), v.utc_offset, 'Offset'
}
assertions.call
v = find_value 84, :datetimeoffset_7, timezone: :local
Expand Down
2 changes: 1 addition & 1 deletion test/thread_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ThreadTest < TinyTds::TestCase
begin
result = client.execute "select dbname()"
result.each { |r| puts r }
rescue Exception => e
rescue Exception => _e
# We are throwing an error on purpose here since 0.6.1 would
# segfault on errors thrown in threads
end
Expand Down