-
Hi @palkan The following issue may be about a bug or about good practice. Reproduction Script: https://gist.github.com/inkstak/448b44bbe97582c26dda00ff043ada4d def manage?
if condition_a?
perform_complicated_check
elsif condition_b?
perform_another_complicated_check
end
end When none of the conditions match, the rule above will return However, it fails using the RSpec DSL describe_rule :manage? do
failed "without any conditions"
end
I thought it was a common practice to accept a predicate method to return The workaround is dead simple : always return But should I add that just to please the specs? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I would say it's not about specs but about the API consistency; predicates must return Thus, it's the latter:
|
Beta Was this translation helpful? Give feedback.
I would say it's not about specs but about the API consistency; predicates must return
true
orfalse
, there should be no third boolean value.Thus, it's the latter: