Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jio
Commits
205247b1
Commit
205247b1
authored
Feb 19, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Activate unionStorage tests
parent
8a7f3c76
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
8 deletions
+42
-8
src/jio.storage/unionstorage.js
src/jio.storage/unionstorage.js
+2
-2
test/jio.storage/unionstorage.tests.js
test/jio.storage/unionstorage.tests.js
+39
-4
test/tests.html
test/tests.html
+1
-2
No files found.
src/jio.storage/unionstorage.js
View file @
205247b1
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
* @class UnionStorage
* @class UnionStorage
*/
*/
(
function
(
jIO
)
{
(
function
(
jIO
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
/**
/**
...
@@ -179,4 +179,4 @@
...
@@ -179,4 +179,4 @@
jIO
.
addStorage
(
'
union
'
,
UnionStorage
);
jIO
.
addStorage
(
'
union
'
,
UnionStorage
);
}(
jIO
));
}(
jIO
,
RSVP
));
test/jio.storage/unionstorage.tests.js
View file @
205247b1
...
@@ -87,6 +87,35 @@
...
@@ -87,6 +87,35 @@
Storage500
.
prototype
.
post
=
generateError
;
Storage500
.
prototype
.
post
=
generateError
;
jIO
.
addStorage
(
'
unionstorage500
'
,
Storage500
);
jIO
.
addStorage
(
'
unionstorage500
'
,
Storage500
);
/////////////////////////////////////////////////////////////////
// unionStorage.constructor
/////////////////////////////////////////////////////////////////
module
(
"
unionStorage.constructor
"
);
test
(
"
no storage list
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
type
:
"
union
"
,
storage_list
:
[]
});
deepEqual
(
jio
.
__storage
.
_storage_list
,
[]);
});
test
(
"
initialize storage list
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
type
:
"
union
"
,
storage_list
:
[{
type
:
"
unionstorage404
"
},
{
type
:
"
unionstorage200
"
}]
});
equal
(
jio
.
__storage
.
_storage_list
.
length
,
2
);
ok
(
jio
.
__storage
.
_storage_list
[
0
]
instanceof
jio
.
constructor
);
equal
(
jio
.
__storage
.
_storage_list
[
0
].
__type
,
"
unionstorage404
"
);
ok
(
jio
.
__storage
.
_storage_list
[
1
]
instanceof
jio
.
constructor
);
equal
(
jio
.
__storage
.
_storage_list
[
1
].
__type
,
"
unionstorage200
"
);
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// unionStorage.get
// unionStorage.get
...
@@ -135,6 +164,7 @@
...
@@ -135,6 +164,7 @@
jio
.
get
({
"
_id
"
:
"
bar
"
})
jio
.
get
({
"
_id
"
:
"
bar
"
})
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
deepEqual
(
result
,
{
deepEqual
(
result
,
{
"
_id
"
:
"
bar
"
,
"
title
"
:
"
foo
"
"
title
"
:
"
foo
"
},
"
Check document
"
);
},
"
Check document
"
);
})
})
...
@@ -162,6 +192,7 @@
...
@@ -162,6 +192,7 @@
jio
.
get
({
"
_id
"
:
"
bar
"
})
jio
.
get
({
"
_id
"
:
"
bar
"
})
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
deepEqual
(
result
,
{
deepEqual
(
result
,
{
"
_id
"
:
"
bar
"
,
"
title
"
:
"
foo
"
"
title
"
:
"
foo
"
},
"
Check document
"
);
},
"
Check document
"
);
})
})
...
@@ -449,7 +480,7 @@
...
@@ -449,7 +480,7 @@
// unionStorage.hasCapacity
// unionStorage.hasCapacity
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
unionStorage.hasCapacity
"
);
module
(
"
unionStorage.hasCapacity
"
);
test
(
"
hasCapacity list
without storage
"
,
function
()
{
test
(
"
Supported capacity
without storage
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
var
jio
=
jIO
.
createJIO
({
type
:
"
union
"
,
type
:
"
union
"
,
...
@@ -457,6 +488,8 @@
...
@@ -457,6 +488,8 @@
});
});
ok
(
jio
.
hasCapacity
(
"
list
"
));
ok
(
jio
.
hasCapacity
(
"
list
"
));
ok
(
jio
.
hasCapacity
(
"
query
"
));
ok
(
jio
.
hasCapacity
(
"
select
"
));
});
});
test
(
"
hasCapacity list not implemented in substorage
"
,
function
()
{
test
(
"
hasCapacity list not implemented in substorage
"
,
function
()
{
...
@@ -477,7 +510,8 @@
...
@@ -477,7 +510,8 @@
function
(
error
)
{
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
status_code
,
501
);
equal
(
error
.
status_code
,
501
);
equal
(
error
.
message
,
"
Capacity 'list' is not implemented
"
);
equal
(
error
.
message
,
"
Capacity 'list' is not implemented on 'unionstorage404'
"
);
return
true
;
return
true
;
}
}
);
);
...
@@ -515,7 +549,7 @@
...
@@ -515,7 +549,7 @@
function
(
error
)
{
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
status_code
,
501
);
equal
(
error
.
status_code
,
501
);
equal
(
error
.
message
,
"
Capacity 'sort' is not implemented
"
);
equal
(
error
.
message
,
"
Capacity 'sort' is not implemented
on 'union'
"
);
return
true
;
return
true
;
}
}
);
);
...
@@ -622,7 +656,8 @@
...
@@ -622,7 +656,8 @@
})
})
.
fail
(
function
(
error
)
{
.
fail
(
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
message
,
"
Capacity 'list' is not implemented
"
);
equal
(
error
.
message
,
"
Capacity 'list' is not implemented on 'unionstorage500'
"
);
equal
(
error
.
status_code
,
501
);
equal
(
error
.
status_code
,
501
);
})
})
.
fail
(
function
(
error
)
{
.
fail
(
function
(
error
)
{
...
...
test/tests.html
View file @
205247b1
...
@@ -31,8 +31,7 @@
...
@@ -31,8 +31,7 @@
<script
src=
"jio.storage/documentstorage.tests.js"
></script>
<script
src=
"jio.storage/documentstorage.tests.js"
></script>
<script
src=
"jio.storage/davstorage.tests.js"
></script>
<script
src=
"jio.storage/davstorage.tests.js"
></script>
<script
src=
"jio.storage/drivetojiomapping.tests.js"
></script>
<script
src=
"jio.storage/drivetojiomapping.tests.js"
></script>
<script
src=
"jio.storage/unionstorage.tests.js"
></script>
<!--script src="jio.storage/unionstorage.tests.js"></script-->
<!--script src="jio.storage/indexeddbstorage.tests.js"></script-->
<!--script src="jio.storage/indexeddbstorage.tests.js"></script-->
<!--script src="jio.storage/indexstorage.tests.js"></script-->
<!--script src="jio.storage/indexstorage.tests.js"></script-->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment