You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the below program, I get an "NoMethodError: undefined method 'gen'". I have experimented, and notice
that the problem goes away as soon as I add a statement to the block so it returns a value.
My perception was that RushCheck::Claim does NOT check the block's return value. Is my perception incorrect, or is there
a bug in RushCheck?
Please your comment,
Thanks,
Frank
require 'rushcheck'
require 'test/unit'
def for_all(*cs, &f)
assert RushCheck::Claim.new(*cs, &f).check
end
class ArrayTest < Test::Unit::TestCase
def test_array
for_all(Integer) do |item|
array= Array.new
array.push item
assert !array.empty? # not ok
end
end
end
The text was updated successfully, but these errors were encountered:
I grasp where is the bug. The following sample should be worked:
class RushCheckTest < Test::Unit::TestCase
should "a tiny example" do
test = Proc.new do |item|
array = Array.new
array.push item
not array.empty?
end
RushCheck::Assertion.new(Integer, &test).check
end
end
class RushCheckTest < Test::Unit::TestCase
should "a tiny example" do
RushCheck::Assertion.new(Integer) do |item|
array = Array.new
array.push item
not array.empty?
end.check
end
end
quotes from rubyforge.org as a ticket referred to #15957
http://rubyforge.org/tracker/index.php?func=detail&aid=15957&group_id=2027&atid=7885
Hi,
When I run the below program, I get an "NoMethodError: undefined method 'gen'". I have experimented, and notice
that the problem goes away as soon as I add a statement to the block so it returns a value.
My perception was that RushCheck::Claim does NOT check the block's return value. Is my perception incorrect, or is there
a bug in RushCheck?
Please your comment,
Thanks,
Frank
The text was updated successfully, but these errors were encountered: