[rspec-users] Mocking question
dchelimsky at gmail.com
Sun Apr 18 12:06:37 EDT 2010
On Thu, Apr 15, 2010 at 6:39 PM, Mark Nijhof
<Mark.Nijhof at cre8ivethought.com> wrote:
> I am working on creating something that will monitor some files and do
> something when they are changed. I am using FSSM for the actual
> monitoring. Now I want to verify that it gets initialized with the
> correct parameters:
> @monitor.path path do
> glob = filter
> So below is my mock setup:
> def setup_monitor_mock
> mock_monitor = mock('monitor')
> But the problem is that I don't know how to verify the values for path
> and filter that are used to setup the monitor are correct. I saw some
> older posts about the same topic, but I couldn't find something
> I hope I explained myself correctly.
I wouldn't use a mock for this. Take a look at FSSM's own specs:
just query the monitor object to make sure it's configured correctly.
I'd do something like that in this case.
More information about the rspec-users