Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make mock mssql adapter handle server_version correctly

  • Loading branch information...
commit ed5ddaeb20bd6ebdcde7de6dff54eabd25cdeee1 1 parent a6a2074
@jeremyevans authored
Showing with 7 additions and 1 deletion.
  1. +5 −0 lib/sequel/adapters/mock.rb
  2. +2 −1  spec/core/mock_adapter_spec.rb
View
5 lib/sequel/adapters/mock.rb
@@ -66,6 +66,11 @@ def primary_key(table)
db.instance_eval do
@primary_key_sequences = {}
end
+ end,
+ 'mssql' => lambda do |db|
+ db.instance_eval do
+ @server_version = 10000000
+ end
end
}
View
3  spec/core/mock_adapter_spec.rb
@@ -439,8 +439,9 @@ class Sequel::Database; @@identifier_output_method=nil; end
end
end
- specify "should automatically set version for postgres" do
+ specify "should automatically set version for postgres and mssql" do
Sequel.mock(:host=>'postgres').server_version.should == 90103
+ Sequel.mock(:host=>'mssql').server_version.should == 10000000
end
specify "should stub out the primary_key method for postgres" do
Please sign in to comment.
Something went wrong with that request. Please try again.