Skip to content

Commit

Permalink
Fixed breaking tests after last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Sep 8, 2015
1 parent 86a4b69 commit 539d46c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 31 deletions.
25 changes: 0 additions & 25 deletions src/Orm/Proxy/Static/database.temporary.js

This file was deleted.

Binary file modified test/implementation/storage/blog.sqlite3
Binary file not shown.
32 changes: 26 additions & 6 deletions test/unit/staticProxy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,37 @@ const path = require('path')
const chai = require('chai')
const expect = chai.expect
const co = require('co')
const Database = require('../../src/Orm/Proxy/Static/database.temporary')
const Database = require('../../src/Database')
const StaticProxy = require('../../src/Orm/Proxy/Static')

let Env = {
get: function(){
return 'sqlite'
}
}

let Config = {
get: function(name){
return {
client: 'sqlite3',
connection: {
filename: path.join(__dirname,'./storage/test.sqlite3')
},
debug: false
}
}
}

const db = new Database(Env,Config)

describe('StaticProxy', function () {

it('should proxy class static methods', function () {

class User{

static extend(){
return new StaticProxy(this,Database);
return new StaticProxy(this,db);
}

static get table(){
Expand All @@ -33,7 +53,7 @@ describe('StaticProxy', function () {
class User{

static extend(){
return new StaticProxy(this,Database);
return new StaticProxy(this,db);
}

static get table(){
Expand All @@ -52,7 +72,7 @@ describe('StaticProxy', function () {
class User{

static extend(){
return new StaticProxy(this,Database);
return new StaticProxy(this,db);
}

static get database(){
Expand All @@ -68,7 +88,7 @@ describe('StaticProxy', function () {
}
}

User.database = Database
User.database = db
User = User.extend()

User
Expand All @@ -86,7 +106,7 @@ describe('StaticProxy', function () {
class User{

static extend(){
return new StaticProxy(this,Database);
return new StaticProxy(this,db);
}
static get table(){
return 'users'
Expand Down

0 comments on commit 539d46c

Please sign in to comment.