var painless = require('../../assertion/painless')
var t        = painless.assert
var test     = painless.createGroup('Test object/stampit (refs)')

var stampit = require('../../../src/object/stamp')

// Basics refs

test('stampit({ refs })', () => {
  const obj = stampit({ refs: { foo: { bar: 'bar' } } }).create();

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.');
});

test('stampit().refs()', () => {
  const obj = stampit().refs({
    foo: { bar: 'bar' },
    refsOverride: false,
    func1() {}
  }).refs({
    bar: 'bar',
    refsOverride: true,
    func2() {}
  }).create();

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.');
  t.is(obj.bar, 'bar',
    'Should set let you add by chaining .refs().');
  t.ok(obj.refsOverride,
    'Should set let you override by chaining .refs().');
  t.ok(obj.func1,
    'Should mix functions.');
  t.ok(obj.func2,
    'Should mix functions.');
});

test('stampit({ refs }).refs()', () => {
  const obj = stampit({ refs: {
    foo: { bar: 'bar' },
    refsOverride: false,
    func1() {}
  }}).refs({
    bar: 'bar',
    refsOverride: true,
    func2() {}
  }).create();

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.');
  t.is(obj.bar, 'bar',
    'Should set let you add by chaining .refs().');
  t.ok(obj.refsOverride,
    'Should set let you override by chaining .refs().');
  t.ok(obj.func1,
    'Should mix functions.');
  t.ok(obj.func2,
    'Should mix functions.');
});

test('stampit().refs(a, b)', () => {
  const obj = stampit().refs({
    a: 'a'
  }, {
    b: 'b'
  }).create();

  t.ok(obj.a && obj.b,
    'Should mixIn objects when multiple properties are passed.');
});

@@ -213,32 +213,151 @@
 efs%0A
-%0Atest('stampit(%7B refs %7D)
+// deprecated as of stampit v3 ... reference (refs) alias to properties%0A%0Atest('stampit(%7B refs %7D) -- syntax no longer in use -- adjustments made
 ', (
@@ -389,25 +389,22 @@
 pit(
-%7B 
+).
 refs
-: %7B 
+(%7B
 foo: %7B
- 
 bar:
@@ -413,13 +413,9 @@
 bar'
- %7D %7D 
+%7D
 %7D).c
@@ -413,33 +413,32 @@
 bar'%7D%7D).create()
-;
 %0A%0A  t.is(obj.foo
@@ -477,29 +477,27 @@
 ault refs.')
-;
 %0A%7D)
-;
 %0A%0Atest('stam
@@ -552,33 +552,32 @@
 efs(%7B%0A    foo: %7B
- 
 bar: 'bar' %7D,%0A  
@@ -562,33 +562,32 @@
 foo: %7Bbar: 'bar'
- 
 %7D,%0A    refsOverr
@@ -599,32 +599,33 @@
 false,%0A    func1
+ 
 () %7B%7D%0A  %7D).refs(
@@ -667,32 +667,33 @@
  true,%0A    func2
+ 
 () %7B%7D%0A  %7D).creat
@@ -687,33 +687,32 @@
 %7B%7D%0A  %7D).create()
-;
 %0A%0A  t.is(obj.foo
@@ -747,33 +747,32 @@
  default refs.')
-;
 %0A  t.is(obj.bar,
@@ -821,33 +821,32 @@
 ining .refs().')
-;
 %0A  t.ok(obj.refs
@@ -902,33 +902,32 @@
 ining .refs().')
-;
 %0A  t.ok(obj.func
@@ -949,33 +949,32 @@
 mix functions.')
-;
 %0A  t.ok(obj.func
@@ -996,37 +996,35 @@
 mix functions.')
-;
 %0A%7D)
-;
 %0A%0Atest('stampit(
@@ -1031,32 +1031,79 @@
 %7B refs %7D).refs()
+ -- syntax no longer in use -- adjustments made
 ', () =%3E %7B%0A  con
@@ -1123,29 +1123,34 @@
 pit(
-%7B 
+)%0A    .
 refs
-: 
+(
 %7B%0A    
+  
 foo: %7B
- 
 bar:
@@ -1159,12 +1159,13 @@
 bar'
- 
 %7D,%0A
+  
     
@@ -1193,21 +1193,24 @@
     
+ 
+ 
 func1
+ 
 () %7B%7D%0A  
 %7D%7D).
@@ -1209,19 +1209,25 @@
 %7D%0A  
-%7D%7D)
+  %7D)%0A    
 .refs(%7B%0A
     
@@ -1214,32 +1214,34 @@
  %7D)%0A    .refs(%7B%0A
+  
     bar: 'bar',%0A
@@ -1236,32 +1236,34 @@
 bar: 'bar',%0A    
+ 
+ 
 refsOverride: tr
@@ -1274,23 +1274,33 @@
     
+  
 func2
+ 
 () %7B%7D%0A
+  
   %7D)
+%0A    
 .cre
@@ -1300,25 +1300,24 @@
    .create()
-;
 %0A%0A  t.is(obj
@@ -1360,25 +1360,24 @@
 ault refs.')
-;
 %0A  t.is(obj.
@@ -1430,33 +1430,32 @@
 ining .refs().')
-;
 %0A  t.ok(obj.refs
@@ -1519,17 +1519,16 @@
 efs().')
-;
 %0A  t.ok(
@@ -1566,17 +1566,16 @@
 tions.')
-;
 %0A  t.ok(
@@ -1613,21 +1613,19 @@
 tions.')
-;
 %0A%7D)
-;
 %0A%0Atest('
@@ -1728,17 +1728,16 @@
 create()
-;
 %0A%0A  t.ok
@@ -1821,10 +1821,8 @@
 d.')
-;
 %0A%7D)
-;
 %0A

update test stamp/basic-refs — stampit v3, lint