@@ -522,18 +522,18 @@ def setup
522522 context "finding out what user_options are available" do
523523
524524 should "run the database consistency checker useroptions command" do
525- @connection . expects ( :select_rows ) . with ( regexp_matches ( /^dbcc\s +useroptions$/i ) , 'SCHEMA' ) . returns [ ]
526- @connection . user_options
525+ keys = [ :textsize , :language , :isolation_level , :dateformat ]
526+ user_options = @connection . user_options
527+ keys . each do |key |
528+ msg = "Expected key:#{ key } in user_options:#{ user_options . inspect } "
529+ assert user_options . key? ( key ) , msg
530+ end
527531 end
528532
529533 should "return a underscored key hash with indifferent access of the results" do
530- @connection . expects ( :select_rows ) . with ( regexp_matches ( /^dbcc\s +useroptions$/i ) , 'SCHEMA' ) . returns [ [ 'some' , 'thing' ] , [ 'isolation level' , 'read uncommitted' ] ]
531- uo = @connection . user_options
532- assert_equal 2 , uo . keys . size
533- assert_equal 'thing' , uo [ 'some' ]
534- assert_equal 'thing' , uo [ :some ]
535- assert_equal 'read uncommitted' , uo [ 'isolation_level' ]
536- assert_equal 'read uncommitted' , uo [ :isolation_level ]
534+ user_options = @connection . user_options
535+ assert_equal 'read committed' , user_options [ 'isolation_level' ]
536+ assert_equal 'read committed' , user_options [ :isolation_level ]
537537 end
538538
539539 end unless sqlserver_azure?
0 commit comments