Forum > General

What is the current state of mocking in Free Pascal

(1/1)

Gustavo 'Gus' Carreno:
Hi Y'all,

As of late I've been trying to up my game in testing.
This means that you come to a point that you need to use Dependency Injection based Mocking in your code in order to have the least coupling of your classes.

From a, not so deep, Google search I found these two projects for Mocking in Object Pascal:

* Delphi Mocks - Maintained and active but for Delphi
* Pascal Mock - Does not seem to be any activity past 2007 (Code is still in CVS)
Is this still the status quo of mocking libraries for Free Pascal?

Because I don't think that the Delphi one will work and I can't comment on the Pascal Mock one since I haven't tried it yet.

Cheers,
Gus

PascalDragon:

--- Quote from: Gustavo 'Gus' Carreno on May 03, 2022, 02:28:04 pm ---From a, not so deep, Google search I found these two projects for Mocking in Object Pascal:

* Delphi Mocks - Maintained and active but for Delphi
* Pascal Mock - Does not seem to be any activity past 2007 (Code is still in CVS)
Is this still the status quo of mocking libraries for Free Pascal?
--- End quote ---

I'm not really aware of anything else and currently your best bet is probably still the Pascal Mock (despite it being not maintained anymore, but if it works there isn't much maintainence needed) as the RTTI functionality is not yet capable of implementing something like Delphi Mocks. This will likely change once the Extended RTTI is implemented, but even then this would only be available with the next release version (probably 3.4).

Gustavo 'Gus' Carreno:
Hey PascalDragon,


--- Quote from: PascalDragon on May 04, 2022, 09:31:33 am ---I'm not really aware of anything else and currently your best bet is probably still the Pascal Mock (despite it being not maintained any more, but if it works there isn't much maintenance needed) as the RTTI functionality is not yet capable of implementing something like Delphi Mocks. This will likely change once the Extended RTTI is implemented, but even then this would only be available with the next release version (probably 3.4).
--- End quote ---

Thanks mate, really appreciate the info you provide !!

Okies, so then, I'll have to get my head around Pascal Mock. Many thanks !!!

BTW, I'm pretty bad at connecting future versions with linear time, so what's your best bet for 3.4?

Cheers,
Gus

PascalDragon:

--- Quote from: Gustavo 'Gus' Carreno on May 05, 2022, 02:31:43 am ---BTW, I'm pretty bad at connecting future versions with linear time, so what's your best bet for 3.4?

--- End quote ---

This decade. :P

Gustavo 'Gus' Carreno:
Hey PascalFragon,


--- Quote from: PascalDragon on May 05, 2022, 09:00:42 am ---
--- Quote from: Gustavo 'Gus' Carreno on May 05, 2022, 02:31:43 am ---BTW, I'm pretty bad at connecting future versions with linear time, so what's your best bet for 3.4?

--- End quote ---

This decade. :P

--- End quote ---

ROTFL !!! 🤣 Fair enough, I did walk into that one with eyes wide open, LOL!!

Thanks mate for the sincere chuckle :D !!

Cheers,
Gus

Navigation

[0] Message Index

Go to full version