Skip to content

sousk/qunit-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qUnit Spec

example

if there’s an object like this:


var cat = {
  mew: function() {
    log('mew mew');
  },
  sings: function() {
    return this.mew();
  }
};

and you can write the test with qUnit Spec:

<cdoe>
  cat = spec(cat);
  
  expect(up(1));
  cat.should_receive('mew');
  cat.sings();
  
  expect(up(2));
  cat.should_receive('mew').and_call(function() {
    return 'nyao nyao';
  });
  equals(cat.sings(), 'nyao nyao');
  
  expect(up(2));
  cat.should_receive('mew').and_return('nyao');
  equals(cat.sings(), 'nyao');

About

rspec like test helper for qUnit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published