» tagged pages
» logout

(Feed found, click Add Page to syndicate.) Error finding feed, please try again » Find feed title

A Blog Page allows you to add entries, for news or other time sensitive postings

(Login required to save to your tagged pages.)
(or Cancel)

Make further edits, (or Cancel)

(Login required to save to your tagged pages.)
(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

Change Page Permissions? Changing these permissions will adjust who can modify this page.

alex (change)
Swik Users (change)
(or Cancel)
Upload an image from your computer:
or Copy an image from a URL:
or Erase the current icon:
Icon Preview:

or Cancel

Erase stub? The contents of stub page and all pages directly attached to stub will be erased.

or Cancel

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:
stub

stub

Tags Applied to stub

No one has tagged this page.

stub Wiki Pages

A stub is a term used in wikis to refer to a page that needs attention to fill out information about the page’s topic.

To fix a stub, fill in a complete set of information on the topic.

sorted by: recent | see : popular
Content Tagged stub

Mocha - Ruby Mocking

This page would be a good top level page!

Mocha is a library for mocking and stubbing within a TestCase using a syntax like that of JMock, and SchMock.

One of its main advantages is that it allows you to mock and stub methods on real (non-mock) classes and instances. You can for example stub ActiveRecord instance methods like create, save, destroy and even class methods like find to avoid hitting the database in unit tests.

Mocha provides a unified, simple and readable syntax for both traditional mocking and for mocking with non-mock objects.

Mocha has been harvested from projects at Reevoo by me (James) and my colleagues Ben, Chris and Paul.

Mocha is in use on real-world Rails projects.

EasyStub

EasyStub is a framework for making stubs. When you find most of time you are using a mock framework to create an object that always returns the same value, and you did not care about the interactions, what you need is actually a stub.

Examples:

to create stub:
  • MyInterface stub = createStub(MyInterface.class);
to return value:
  • make(stub.hello()).returning(‘hello’);
to throw exception:
  • make(stub.hello()).throwing(expectedException);
to throw exception for method without return value:
  • stub.nothing();
  • willThrow(expectedException);

Username:
Password:
(or Cancel)