projects
/
rails.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Disable OSM export when the area is too large.
[rails.git]
/
vendor
/
gems
/
rspec-1.1.2
/
examples
/
pure
/
before_and_after_example.rb
1
require File.dirname(__FILE__) + '/spec_helper'
2
$global = 0
3
4
describe "State created in before(:all)" do
5
before :all do
6
@sideeffect = 1
7
$global +=1
8
end
9
10
before :each do
11
@isolated = 1
12
end
13
14
it "should be accessible from example" do
15
@sideeffect.should == 1
16
$global.should == 1
17
@isolated.should == 1
18
19
@sideeffect += 1
20
@isolated += 1
21
end
22
23
it "should not have sideffects" do
24
@sideeffect.should == 1
25
$global.should == 2
26
@isolated.should == 1
27
28
@sideeffect += 1
29
@isolated += 1
30
end
31
32
after :each do
33
$global += 1
34
end
35
36
after :all do
37
$global.should == 3
38
$global = 0
39
end
40
end