testing ruleby with rspec

5 views
Skip to first unread message

Michael Klein

unread,
Nov 17, 2011, 6:05:59 AM11/17/11
to Ruleby
Hi!

Are there any best practices on how to test ruleby rulebooks with
rspec? I want to test if a rule correctly calls a method when it's
conditions are fulfilled.

The code in the github-repo is tested by asserting a Success-Object to
the fact base. This code is called inside the rulebook. But this is
code that would be called when I used the rulebook in production. The
Success-Class is created in spec_helper.rb. This code will not be
available in a production environment.

Is there any way to test this without creating Success-Objects? I feel
that's a very hacky way to test the execution of a rule. Is there any
better way?

Best regards,
Mike
Reply all
Reply to author
Forward
0 new messages