Skip to content
Browse files

Tests for Object.setByPath

  • Loading branch information...
1 parent f55c257 commit b8496edb099c47efb466902e8301fdc0475e4057 Ruslan Sukhar committed May 23, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 Tests/Specs/1.3/Types/Object.Extras.js
View
18 Tests/Specs/1.3/Types/Object.Extras.js
@@ -5,6 +5,24 @@ requires: [More/Object.Extras]
provides: [Object.Extras.Tests]
...
*/
+describe('Object.setByPath', function(){
+
+ it('should set an object value by a path', function(){
+ var obj = {
+ animal: {
+ human: {
+ most_deadly: 'ninja'
+ }
+ }
+ };
+ Object.setByPath('chuck norris', 'animal.human.most_deadly');
+ Object.setByPath('shay maria', 'animal.human.most_lovely');
+ expect(obj.animal.human.most_deadly).toEqual('chuck norris');
+ expect(obj.animal.human.most_lovely).toEqual('shay maria');
+ });
+
+});
+
describe('Object.getFromPath', function(){
it('should retrieve an object value from a path', function(){

0 comments on commit b8496ed

Please sign in to comment.
Something went wrong with that request. Please try again.