Skip to content

Commit 19e2432

Browse files
committed
Silence structure dumps to avoid TinyTDS binstub puts.
1 parent 8338d12 commit 19e2432

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/cases/rake_test_sqlserver.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class SQLServerRakeStructureDumpLoadTest < SQLServerRakeTest
122122
it 'dumps structure and accounts for defncopy oddities' do
123123
# CHANGED: [TinyTDS] When utilities are available http://git.io/v3tBk
124124
skip if host_windows?
125-
db_tasks.structure_dump configuration, filename
125+
structure_dump configuration, filename
126126
filedata.wont_match %r{\AUSE.*\z}
127127
filedata.wont_match %r{\AGO.*\z}
128128
filedata.must_match %r{email\s+nvarchar\(4000\)}
@@ -133,12 +133,22 @@ class SQLServerRakeStructureDumpLoadTest < SQLServerRakeTest
133133
it 'can load dumped structure' do
134134
# CHANGED: [TinyTDS] When utilities are available http://git.io/v3tBk
135135
skip if host_windows?
136-
db_tasks.structure_dump configuration, filename
136+
structure_dump configuration, filename
137137
filedata.must_match %r{CREATE TABLE dbo\.users}
138138
db_tasks.purge(configuration)
139139
connection.tables.wont_include 'users'
140140
db_tasks.load_schema_for configuration, :sql, filename
141141
connection.tables.must_include 'users'
142142
end
143143

144+
private
145+
146+
def structure_dump(configuration, filename)
147+
original_stdout = $stdout
148+
$stdout = StringIO.new
149+
db_tasks.structure_dump(configuration, filename)
150+
ensure
151+
$stdout = original_stdout
152+
end
153+
144154
end

0 commit comments

Comments
 (0)