Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit f2701381
authored
Aug 16, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for sequelize -c
1 parent
8c291394
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
test/binary/sequelize.test.bats
test/binary/sequelize.test.bats
View file @
f270138
...
@@ -219,3 +219,51 @@
...
@@ -219,3 +219,51 @@
cd ../../..
cd ../../..
}
}
@test "-c creates a new file with the current timestamp" {
cd test/binary/tmp
rm -rf ./*
../../../bin/sequelize -i
../../../bin/sequelize -c "foo"
needle=`node -e "var d=new Date(); var f=function(i){ return (parseInt(i, 10) < 10 ? '0' + i : i) }; console.log([d.getFullYear(), f(d.getMonth() + 1), f(d.getDate()), f(d.getHours()), f(d.getMinutes()), f(d.getSeconds())].join(''))"`
run ls -1 migrations
[ $status -eq 0 ]
[ $(expr "${lines[0]}" : "${needle}-foo.js") -ne 0 ]
cd ../../..
}
@test "-c adds a skeleton with an up and a down method" {
cd test/binary/tmp
rm -rf ./*
../../../bin/sequelize -i
../../../bin/sequelize -c "foo"
run cat migrations/*-foo.js
[ $status -eq 0 ]
[ $(expr "${lines[1]}" : " up: function(migration, DataTypes, done) {") -ne 0 ]
[ $(expr "${lines[5]}" : " down: function(migration, DataTypes, done) {") -ne 0 ]
cd ../../..
}
@test "-c calls the done callback" {
cd test/binary/tmp
rm -rf ./*
../../../bin/sequelize -i
../../../bin/sequelize -c "foo"
run cat migrations/*-foo.js
[ $status -eq 0 ]
[ $(expr "${lines[3]}" : " done()") -ne 0 ]
[ $(expr "${lines[7]}" : " done()") -ne 0 ]
cd ../../..
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment