Tuesday, 9th March 2010.

Posted on Sunday, 19th October 2008 by charpi

I worked on erl_mock in order to publish my spike around mocks in
erlang. When I was almost ready to make the package, something interesting happened: my tests failed.
More precisely, they failed when run by the ‘future’ version of extremeforge.
After the first surprise, I find the reason. Extremeforge use 2 nodes,
the first one will find, order [...]

Tags: , ,
Posted in Uncategorized | Comments (0)

Posted on Thursday, 9th October 2008 by charpi

In my previous post, I described a way to mock module by replacing
them. Today, I’ll post a version closer to other mock
library. Basically, I create on mock module on the fly and forward all
calls to a process. You can tell to this process how to answer for
each calls.
Here is the test :

%%% Copyright (c) 2008 [...]

Tags: ,
Posted in Uncategorized | Comments (6)

Posted on Wednesday, 8th October 2008 by charpi

In my previous post, I wrote a test to specify a lazy
mock. In my mind, a lazy mock consists to replace the implementation
of one module by another one at runtime.
Here is the implementation of the lazy mock test

-module(mock).

-export([replace_module /2]).

replace_module (Module, Mock_module) ->
uninstall (Module),
{ok, Binary} = file: read_file [...]

Tags: ,
Posted in Uncategorized | Comments (0)

Posted on Friday, 3rd October 2008 by charpi

People coming from object oriented programming often use mock
object in their unittest. The main question is do we need mock
when programming with erlang ? .
The answer could be we don’t need any mock library because it’s
already part of the language.
Let me explain a little more my vision of mock in Erlang.
The main purpose of [...]

Tags: ,
Posted in Uncategorized | Comments (1)

About me Downloads