Created
April 2, 2012 13:59
-
-
Save nashbridges/2283634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyApp | |
module GlobalHelpers | |
def self.included(base) | |
base.let(:beer) { :good } | |
base.before(:all) { @bottles = 10 } | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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