From 1378e5819affacecbc1291d1e676fd8d5efeafc2 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sun, 10 Feb 2008 18:42:32 +0100 Subject: Empty specifications are now erroneous darcs-hash:20080210174232-4fc50-502a7c3601bcbd28b1ec6befde599762d939effa.gz --- lib/bacon.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/bacon.rb') diff --git a/lib/bacon.rb b/lib/bacon.rb index 72342a3..3277503 100644 --- a/lib/bacon.rb +++ b/lib/bacon.rb @@ -140,7 +140,12 @@ module Bacon begin Counter[:depth] += 1 @before.each { |block| instance_eval(&block) } + prev_req = Counter[:requirements] instance_eval(&spec) + if Counter[:requirements] == prev_req + raise Error.new(:missing, + "empty specification: #{@name} #{description}") + end @after.each { |block| instance_eval(&block) } rescue Object => e ErrorLog << "#{e.class}: #{e.message}\n" -- cgit 1.4.1