diff options
-rw-r--r-- | lib/bacon.rb | 5 | ||||
-rw-r--r-- | test/spec_should.rb | 3 |
2 files changed, 7 insertions, 1 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" diff --git a/test/spec_should.rb b/test/spec_should.rb index 25557a3..c31e8c7 100644 --- a/test/spec_should.rb +++ b/test/spec_should.rb @@ -3,7 +3,8 @@ require File.join(File.dirname(__FILE__), '../lib/bacon') describe "#should shortcut for #it('should')" do should "be called" do - @called= true + @called = true + @called.should.be == true end should "save some characters by typing should" do |