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

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

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

  t.ok(obj.foo() && !obj.hasOwnProperty('foo'),
    'Should set the new object\'s prototype.');
});

test('stampit().methods()', () => {
  const obj = stampit().methods({
    foo() { return 'foo'; },
    methodOverride() { return false; },
    prop1: 1
  }).methods({
    bar() { return 'bar'; },
    methodOverride() { return true; },
    prop2: 2
  }).create();

  t.ok(obj.foo() && !obj.hasOwnProperty('foo'),
    'Should set the new object\'s prototype.');
  t.ok(obj.bar() && !obj.hasOwnProperty('bar'),
    'Should let you chain .methods() to add more.');
  t.ok(obj.methodOverride() && !obj.hasOwnProperty('methodOverride'),
    'Should let you override by chaining .methods().');
  t.ok(obj.prop1 && !obj.hasOwnProperty('prop1'),
    'Should mix properties.');
  t.ok(obj.prop2 && !obj.hasOwnProperty('prop1'),
    'Should mix properties.');
});

test('stampit({ methods }).methods()', () => {
  const obj = stampit({ methods: {
    foo() { return 'foo'; },
    methodOverride() { return false; },
    prop1: 1
  }}).methods({
    bar() { return 'bar'; },
    methodOverride() { return true; },
    prop2: 2
  }).create();

  t.ok(obj.foo() && !obj.hasOwnProperty('foo'),
    'Should set the new object\'s prototype.');
  t.ok(obj.bar() && !obj.hasOwnProperty('bar'),
    'Should let you chain .methods() to add more.');
  t.ok(obj.methodOverride() && !obj.hasOwnProperty('methodOverride'),
    'Should let you override by chaining .methods().');
  t.ok(obj.prop1 && !obj.hasOwnProperty('prop1'),
    'Should mix properties.');
  t.ok(obj.prop2 && !obj.hasOwnProperty('prop1'),
    'Should mix properties.');
});

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

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

@@ -252,35 +252,34 @@
 j = stampit(
-%7B 
+).
 methods
-: 
+(
 %7B%0A    foo() 
@@ -267,37 +267,37 @@
 ethods(%7B%0A    foo
+ 
 () %7B
- 
 return 'foo'; %7D%0A
@@ -292,23 +292,20 @@
 rn 'foo'
-; 
 %7D%0A  
-%7D
 %7D).creat
@@ -299,33 +299,32 @@
 '%7D%0A  %7D).create()
-;
 %0A%0A  t.ok(obj.foo
@@ -1237,19 +1237,21 @@
 pit(
-%7B 
+)%0A  .
 methods
-: 
+(
 %7B%0A  
@@ -1333,18 +1333,20 @@
 1: 1%0A  %7D
-%7D
 )
+%0A  
 .methods
@@ -1886,33 +1886,33 @@
 wnProperty('prop
-1
+2
 '),%0A    'Should 

update test stamp/basic-methods — stampit v3