不要怂,就是干,撸起袖子干!

Commit 64c29225 by Mick Hansen

set the _dialect on query generator in dialect specific tests

1 parent ada11189
...@@ -113,7 +113,7 @@ module.exports = (function() { ...@@ -113,7 +113,7 @@ module.exports = (function() {
} }
try { try {
this.dialect = new (require("./dialects/" + this.getDialect()))(this) this.dialect = new (require("./dialects/" + this.getDialect()))(this)
} catch(err) { } catch(err) {
throw new Error("The dialect " + this.getDialect() + " is not supported.") throw new Error("The dialect " + this.getDialect() + " is not supported.")
} }
......
...@@ -516,6 +516,7 @@ if (Support.dialectIsMySQL()) { ...@@ -516,6 +516,7 @@ if (Support.dialectIsMySQL()) {
test.arguments[1] = test.arguments[1](this.sequelize) test.arguments[1] = test.arguments[1](this.sequelize)
} }
QueryGenerator.options = context.options QueryGenerator.options = context.options
QueryGenerator._dialect = this.sequelize.dialect
var conditions = QueryGenerator[suiteTitle].apply(QueryGenerator, test.arguments) var conditions = QueryGenerator[suiteTitle].apply(QueryGenerator, test.arguments)
expect(conditions).to.deep.equal(test.expectation) expect(conditions).to.deep.equal(test.expectation)
done() done()
......
...@@ -904,6 +904,7 @@ if (dialect.match(/^postgres/)) { ...@@ -904,6 +904,7 @@ if (dialect.match(/^postgres/)) {
test.arguments[1] = test.arguments[1](this.sequelize) test.arguments[1] = test.arguments[1](this.sequelize)
} }
QueryGenerator.options = context.options QueryGenerator.options = context.options
QueryGenerator._dialect = this.sequelize.dialect
var conditions = QueryGenerator[suiteTitle].apply(QueryGenerator, test.arguments) var conditions = QueryGenerator[suiteTitle].apply(QueryGenerator, test.arguments)
expect(conditions).to.deep.equal(test.expectation) expect(conditions).to.deep.equal(test.expectation)
done() done()
......
...@@ -444,6 +444,7 @@ if (dialect === 'sqlite') { ...@@ -444,6 +444,7 @@ if (dialect === 'sqlite') {
test.arguments[1] = test.arguments[1](this.sequelize) test.arguments[1] = test.arguments[1](this.sequelize)
} }
QueryGenerator.options = context.options QueryGenerator.options = context.options
QueryGenerator._dialect = this.sequelize.dialect
var conditions = QueryGenerator[suiteTitle].apply(QueryGenerator, test.arguments) var conditions = QueryGenerator[suiteTitle].apply(QueryGenerator, test.arguments)
expect(conditions).to.deep.equal(test.expectation) expect(conditions).to.deep.equal(test.expectation)
done() done()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!