lib/prop_check/rspec.rb in prop_check-0.6.2 vs lib/prop_check/rspec.rb in prop_check-0.7.0

- old
+ new

@@ -3,11 +3,15 @@ # Integration with RSpec module RSpec # To make it available within examples def self.extend_object(obj) obj.define_method(:forall) do |*args, **kwargs, &block| - PropCheck::Property.forall(*args, **kwargs) do - instance_exec(self, &block) + if block_given? + PropCheck::Property.forall(*args, **kwargs) do + instance_exec(self, &block) + end + else + PropCheck::Property.forall(*args, **kwargs) end end end end end