lib/power_assert/context.rb in power_assert-1.1.2 vs lib/power_assert/context.rb in power_assert-1.1.3
- old
+ new
@@ -177,9 +177,11 @@
locs = PowerAssert.app_caller_locations
path = locs.last.path
lineno = locs.last.lineno
if File.exist?(path)
line ||= File.open(path) {|fp| fp.each_line.drop(lineno - 1).first }
+ end
+ if line
@parser = Parser.new(line, path, lineno, @assertion_proc.binding, assertion_method.to_s, @assertion_proc)
end
end
end
end