diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2008-02-10 18:42:32 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2008-02-10 18:42:32 +0100 |
commit | 1378e5819affacecbc1291d1e676fd8d5efeafc2 (patch) | |
tree | 792da43c897ed5aeae8d6f5bae580eaafa71507c /lib | |
parent | 96f476e7ad3e0ff5951df57f07f38164a021e1b5 (diff) | |
download | bacon-1378e5819affacecbc1291d1e676fd8d5efeafc2.tar.gz bacon-1378e5819affacecbc1291d1e676fd8d5efeafc2.tar.xz bacon-1378e5819affacecbc1291d1e676fd8d5efeafc2.zip |
Empty specifications are now erroneous
darcs-hash:20080210174232-4fc50-502a7c3601bcbd28b1ec6befde599762d939effa.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bacon.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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" |