Skip to content

Instantly share code, notes, and snippets.

@nashbridges
Created April 2, 2012 13:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nashbridges/2283634 to your computer and use it in GitHub Desktop.
Save nashbridges/2283634 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe "Brewery" do
it "makes good stuff" do
beer.should be :good
end
it "makes not too much bottles" do
@bottles.should == 10
end
context "when tasting beer" do
before(:all) do
@bottles -= 1
end
it "still produces good stuff" do
beer.should be :good
end
it "spends some beer on degusting" do
@bottles.should == 9
end
end
end
module MyApp
module GlobalHelpers
def self.included(base)
base.let(:beer) { :good }
base.before(:all) { @bottles = 10 }
end
end
end
require 'global_helpers'
RSpec.configure do |config|
config.include MyApp::GlobalHelpers
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment