@@ -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{\A USE.*\z }
127127 filedata . wont_match %r{\A GO.*\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+
144154end
0 commit comments