Skip to content

Simple javascript stub utility translated from Ruby's MiniTest

Notifications You must be signed in to change notification settings

ericgj/ministub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ministub

Simple stub utility translated from Ruby's MiniTest

Installation

$ component install ericgj/ministub

API

Stub( obj, name, val_or_fn, fn )

Stub the method name of obj with val_or_fn for the duration of block fn.

Examples

var stub = require('ministub');

var foo = { bar: 'bar' };

stub(foo, 'bar', 'baz', function(){
  foo.bar  // 'baz'
});

foo.bar  // 'bar'

License

MIT

About

Simple javascript stub utility translated from Ruby's MiniTest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published