summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorrff.rff <rff.rff@gmail.com>2008-01-23 23:59:40 +0100
committerrff.rff <rff.rff@gmail.com>2008-01-23 23:59:40 +0100
commit1900d706e433dd275ee86992c99ecca32949edc3 (patch)
treea73b4bd6f8711feae5507612bf423e3b2c35ac30 /test
parentfe569b343f2522f2d0ba965c4c54b8aac695f02e (diff)
downloadbacon-1900d706e433dd275ee86992c99ecca32949edc3.tar.gz
bacon-1900d706e433dd275ee86992c99ecca32949edc3.tar.xz
bacon-1900d706e433dd275ee86992c99ecca32949edc3.zip
allows multiple arguments to #describe to allow specialized behaviours such as
 describe Queue,'empty'
 describe Queue,'full'

Some tests for this and manveru's latest patch are included

darcs-hash:20080123225940-16231-8d28039e863f52902c390f666b710c5a1d59cf53.gz
Diffstat (limited to 'test')
-rw-r--r--test/spec_bacon.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/spec_bacon.rb b/test/spec_bacon.rb
index b0cb510..0d8aefa 100644
--- a/test/spec_bacon.rb
+++ b/test/spec_bacon.rb
@@ -308,3 +308,32 @@ describe "shared/behaves_like" do
   }
   behaves_like "another shared context"
 end
+
+describe 'describe arguments' do
+
+  def check(ctx,name)
+    ctx.should.be.an.instance_of Bacon::Context
+    ctx.instance_variable_get('@name').should == name
+  end
+
+  it 'should work with string' do
+   check(describe( 'string') {},'string')
+  end
+
+  it 'should work with symbols' do
+   check(describe( :behaviour) {},'behaviour')
+  end
+   
+  it 'should work with modules' do
+   check(describe( Bacon) {},'Bacon')
+  end
+
+  it 'should work with namespaced modules' do
+   check(describe( Bacon::Context) {},'Bacon::Context')
+  end
+
+  it 'should work with multiple arguments' do
+   check(describe( Bacon::Context, :empty) {},'Bacon::Context empty')
+  end
+
+end