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 d407fdfc
authored
Dec 14, 2011
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved utils specs
1 parent
01f3180c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
19 deletions
spec/utils.spec.js
test/Utils/underscore.js
spec/utils.spec.js
View file @
d407fdf
...
...
@@ -36,4 +36,34 @@ describe('Utils', function() {
expect
(
result
).
toMatch
(
/.*alert
\(
2
\)
.*/
)
})
})
describe
(
'underscore'
,
function
()
{
describe
(
'underscoredIf'
,
function
()
{
it
(
'is defined'
,
function
()
{
expect
(
Utils
.
_
.
underscoredIf
).
toBeDefined
()
})
it
(
'underscores if second param is true'
,
function
()
{
expect
(
Utils
.
_
.
underscoredIf
(
'fooBar'
,
true
)).
toEqual
(
'foo_bar'
)
})
it
(
"doesn't underscore if second param is false"
,
function
()
{
expect
(
Utils
.
_
.
underscoredIf
(
'fooBar'
,
false
)).
toEqual
(
'fooBar'
)
})
})
describe
(
'camelizeIf'
,
function
()
{
it
(
'is defined'
,
function
()
{
expect
(
Utils
.
_
.
camelizeIf
).
toBeDefined
()
})
it
(
'camelizes if second param is true'
,
function
()
{
expect
(
Utils
.
_
.
camelizeIf
(
'foo_bar'
,
true
)).
toEqual
(
'fooBar'
)
})
it
(
"doesn't camelize if second param is false"
,
function
()
{
expect
(
Utils
.
_
.
underscoredIf
(
'fooBar'
,
true
)).
toEqual
(
'foo_bar'
)
})
})
})
})
test/Utils/underscore.js
deleted
100644 → 0
View file @
01f3180
var
assert
=
require
(
"assert"
)
,
Utils
=
require
(
"../../lib/utils"
)
module
.
exports
=
{
'underscoredIf should be defined'
:
function
()
{
assert
.
isDefined
(
Utils
.
_
.
underscoredIf
)
},
'underscoredIf should work correctly'
:
function
()
{
assert
.
eql
(
Utils
.
_
.
underscoredIf
(
'fooBar'
,
false
),
'fooBar'
)
assert
.
eql
(
Utils
.
_
.
underscoredIf
(
'fooBar'
,
true
),
'foo_bar'
)
},
'camelizeIf should be defined'
:
function
()
{
assert
.
isDefined
(
Utils
.
_
.
camelizeIf
)
},
'camelizeIf should work correctly'
:
function
()
{
assert
.
eql
(
Utils
.
_
.
camelizeIf
(
'foo_bar'
,
false
),
'foo_bar'
)
assert
.
eql
(
Utils
.
_
.
camelizeIf
(
'foo_bar'
,
true
),
'fooBar'
)
}
}
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