summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorGabriel Horner <gabriel.horner@gmail.com>2010-03-20 04:19:18 -0400
committerGabriel Horner <gabriel.horner@gmail.com>2010-03-20 04:19:18 -0400
commit862244cf77543af841c67e380ef2ee160fed1d76 (patch)
tree045d2ce1722c3c5b5c6c6901fa3d8367d01b8a84 /test
parent0aaf725af9c43ccc97597e6d4621bcc88b290367 (diff)
downloadbacon-862244cf77543af841c67e380ef2ee160fed1d76.tar.gz
bacon-862244cf77543af841c67e380ef2ee160fed1d76.tar.xz
bacon-862244cf77543af841c67e380ef2ee160fed1d76.zip
methods in a context should serve as behavior that is inherited by sibling contexts
Diffstat (limited to 'test')
-rw-r--r--test/spec_bacon.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/spec_bacon.rb b/test/spec_bacon.rb
index b1360be..79cdeb1 100644
--- a/test/spec_bacon.rb
+++ b/test/spec_bacon.rb
@@ -344,6 +344,22 @@ describe "shared/behaves_like" do
   behaves_like "another shared context"
 end
 
+describe "Methods" do
+  def the_meaning_of_life
+    42
+  end
+
+  it "should be accessible in a test" do
+    the_meaning_of_life.should == 42
+  end
+
+  describe "when in a sibling context" do
+    it "should be accessible in a test" do
+      the_meaning_of_life.should == 42
+    end
+  end
+end
+
 describe 'describe arguments' do
 
   def check(ctx,name)