Skip to content

Instantly share code, notes, and snippets.

@fixlr
Created June 14, 2013 19:42
Show Gist options
  • Save fixlr/5784662 to your computer and use it in GitHub Desktop.
Save fixlr/5784662 to your computer and use it in GitHub Desktop.
class BlobGatherer
@@blobs = %w(foo bar baz qux)
def self.gather
@@blobs.shift
end
end
describe 'Before' do
context ':all' do
before(:all) do
@blobs = BlobGatherer.gather
end
specify { @blobs.should == 'foo' }
specify { @blobs.should == 'foo' }
specify { @blobs.should == 'foo' }
end
context ':each' do
before(:each) do
@blobs = BlobGatherer.gather
end
specify { @blobs.should == 'bar' }
specify { @blobs.should == 'baz' }
specify { @blobs.should == 'qux' }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment