From 7c7f279c9b61a89240f93c0339042cbd7485d0c5 Mon Sep 17 00:00:00 2001 From: "rff.rff" Date: Mon, 14 Jan 2008 01:34:44 +0100 Subject: add should('foo') shortcut for it('should foo') darcs-hash:20080114003444-16231-e4a97d3932c8636751d72f101e0363c124522390.gz --- lib/bacon.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/bacon.rb b/lib/bacon.rb index 945f1f1..0bede91 100644 --- a/lib/bacon.rb +++ b/lib/bacon.rb @@ -125,6 +125,14 @@ module Bacon Counter[:specifications] += 1 run_requirement description, block end + + def should(*args, &block) + if Counter[:depth]==0 + it('should '+args.first,&block) + else + super(*args,&block) + end + end def run_requirement(description, spec) Bacon.handle_requirement description do -- cgit 1.4.1