Permalink
Browse files

removed semi colons from coffeescript files

  • Loading branch information...
1 parent 790e2d1 commit 261574ab1bdff87d3058fe878130e2a4a79729dd Karl Seguin committed May 5, 2012
@@ -1,6 +1,6 @@
-massive = require("../index");
-should = require("should");
-util = require("util");
+massive = require("../index")
+should = require("should")
+util = require("util")
describe "MySQL Queries", ->
db = null
@@ -11,7 +11,7 @@ describe "MySQL Queries", ->
describe "initialization", ->
- it "sets the table name", ->
+ it "sets the table name", ->
db.products.name.should.equal("products")
it "defaults the pk to id", ->
@@ -46,11 +46,11 @@ describe "MySQL Queries", ->
it "adds a LIMIT if specified", ->
- query = db.products.find(5).limit(1);
+ query = db.products.find(5).limit(1)
query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT 1")
it "adds a LIMIT with SKIP if specified", ->
- query = db.products.find(5).limit(10,1);
+ query = db.products.find(5).limit(10,1)
query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT(10,1)")
it "adds an ORDER if specified", ->
@@ -88,7 +88,7 @@ describe "MySQL Queries", ->
query.params.length.should.equal 3
it "handles inline goodness", ->
- query = db.run("select * from crazytown where id = ?", [1]);
+ query = db.run("select * from crazytown where id = ?", [1])
query.sql.should.equal("select * from crazytown where id = ?")
query.params.length.should.equal 1
@@ -116,11 +116,11 @@ describe "MySQL Queries", ->
query.params.length.should.equal 2
it "creates a batch for item arrays", ->
- items = [{title:"stuffy stuff", price: 12.00, desc : "bubble"},{title:"poofy poof", price: 24.00, desc : "glurp"}];
+ items = [{title:"stuffy stuff", price: 12.00, desc : "bubble"},{title:"poofy poof", price: 24.00, desc : "glurp"}]
query = db.products.insert(items)
query.sql.should.equal "INSERT INTO products (title, price, desc) VALUES\n(?, ?, ?),\n(?, ?, ?)"
query.params.length.should.equal 6
-
+
it "throws an error if no data was supplied", ->
(-> db.products.insert().execute()).should.throw
@@ -129,7 +129,7 @@ describe "MySQL Queries", ->
query = db.products.update({name:"pumpkin", price:1000}, 12)
query.sql.should.equal("UPDATE products SET name = ?, price = ? \nWHERE \"id\" = 12")
query.params.length.should.equal 2
-
+
it "creates a basic update with a string key", ->
query = db.products.update({name:"pumpkin", price:1000}, "12")
query.sql.should.equal("UPDATE products SET name = ?, price = ? \nWHERE \"id\" = ?")
@@ -149,9 +149,8 @@ describe "MySQL Queries", ->
describe "aggregates", ->
it "counts with SELECT COUNT", ->
query = db.products.count()
- query.sql.should.equal("SELECT COUNT(1) FROM products");
+ query.sql.should.equal("SELECT COUNT(1) FROM products")
it "counts with SELECT COUNT and a WHERE", ->
query = db.products.count({"id > " : 1})
- query.sql.should.equal("SELECT COUNT(1) FROM products \nWHERE \"id\" > 1");
+ query.sql.should.equal("SELECT COUNT(1) FROM products \nWHERE \"id\" > 1")
-
@@ -1,6 +1,6 @@
-massive = require("../index");
-should = require("should");
-util = require("util");
+massive = require("../index")
+should = require("should")
+util = require("util")
describe "schema queries", ->
@@ -9,13 +9,13 @@ describe "schema queries", ->
massive.connect {user : "root", password : "", database : "test"}, (err,_db) ->
db = _db
done()
-
+
it "should exist", ->
should.exist db
describe "dropTable", ->
it "creates a drop statement", ->
- db.dropTable("cheese").sql.should.equal("DROP TABLE IF EXISTS cheese;");
+ db.dropTable("cheese").sql.should.equal("DROP TABLE IF EXISTS cheese;")
describe "create table", ->
@@ -1,6 +1,6 @@
-massive = require("../index");
-should = require("should");
-util = require("util");
+massive = require("../index")
+should = require("should")
+util = require("util")
describe "Connections", ->
db = null
@@ -5,7 +5,7 @@ class Helper
process.env.MASSIVE_PG_TEST || "postgres://postgres@localhost/test"
@setup: ->
- massive = require("../index");
+ massive = require("../index")
massive.connect @connectionString(), (err, db) ->
db.createTable('products', {name: 'string'}).execute () -> db.end()
@@ -1,6 +1,6 @@
-massive = require("../index");
-should = require("should");
-util = require("util");
+massive = require("../index")
+should = require("should")
+util = require("util")
helper = require('./pg_helper')
describe "Postgres Queries", ->
@@ -46,11 +46,11 @@ describe "Postgres Queries", ->
it "adds a LIMIT if specified", ->
- query = db.products.find(5).limit(1);
+ query = db.products.find(5).limit(1)
query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT 1")
it "adds a LIMIT with SKIP if specified", ->
- query = db.products.find(5).limit(10,1);
+ query = db.products.find(5).limit(10,1)
query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT(10,1)")
it "adds an ORDER if specified", ->
@@ -88,7 +88,7 @@ describe "Postgres Queries", ->
query.params.length.should.equal 3
it "handles inline goodness", ->
- query = db.run("select * from crazytown where id = $1", [1]);
+ query = db.run("select * from crazytown where id = $1", [1])
query.sql.should.equal("select * from crazytown where id = $1")
query.params.length.should.equal 1
@@ -116,7 +116,7 @@ describe "Postgres Queries", ->
query.params.length.should.equal 2
it "creates a batch for item arrays", ->
- items = [{title:"stuffy stuff", price: 12.00, desc : "bubble"},{title:"poofy poof", price: 24.00, desc : "glurp"}];
+ items = [{title:"stuffy stuff", price: 12.00, desc : "bubble"},{title:"poofy poof", price: 24.00, desc : "glurp"}]
query = db.products.insert(items)
query.sql.should.equal "INSERT INTO products (title, price, desc) VALUES\n($1, $2, $3),\n($4, $5, $6) \nRETURNING *"
query.params.length.should.equal 6
@@ -149,10 +149,10 @@ describe "Postgres Queries", ->
describe "aggregates", ->
it "counts with SELECT COUNT", ->
query = db.products.count()
- query.sql.should.equal("SELECT COUNT(1) FROM products");
+ query.sql.should.equal("SELECT COUNT(1) FROM products")
it "counts with SELECT COUNT and a WHERE", ->
query = db.products.count({"id > " : 1})
- query.sql.should.equal("SELECT COUNT(1) FROM products \nWHERE \"id\" > 1");
+ query.sql.should.equal("SELECT COUNT(1) FROM products \nWHERE \"id\" > 1")
describe "events", ->
@@ -173,7 +173,4 @@ describe "Postgres Queries", ->
should.exist result
it "tables should have an each method", ->
- should.exist db.products.each
-
-
-
+ should.exist db.products.each
@@ -1,6 +1,6 @@
-massive = require("../index");
-should = require("should");
-util = require("util");
+massive = require("../index")
+should = require("should")
+util = require("util")
helper = require('./pg_helper')
describe "schema queries", ->
@@ -15,7 +15,7 @@ describe "schema queries", ->
describe "dropTable", ->
it "creates a drop statement", ->
- db.dropTable("cheese").sql.should.equal("DROP TABLE IF EXISTS cheese;");
+ db.dropTable("cheese").sql.should.equal("DROP TABLE IF EXISTS cheese;")
describe "create table", ->
@@ -49,4 +49,4 @@ describe "schema queries", ->
it "adds created and updated for timestamps", ->
query = db.createTable "cheese",{timestamps:true}
- query.sql.indexOf("created_at timestamptz not null default 'now',updated_at timestamptz not null default 'now'").should.be.greaterThan(0)
+ query.sql.indexOf("created_at timestamptz not null default 'now',updated_at timestamptz not null default 'now'").should.be.greaterThan(0)
View
@@ -1,6 +1,6 @@
-massive = require("../index");
-should = require("should");
-util = require("util");
+massive = require("../index")
+should = require("should")
+util = require("util")
helper = require('./pg_helper')
describe "Connections", ->

0 comments on commit 261574a

Please sign in to comment.