Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 32 lines (22 sloc) 0.804 kb
73b104e @dchelimsky Ruby.1.9 info => rdoc
authored
1 = RSpec and Ruby 1.9
45981b6 @dchelimsky Ruby 1.9 - Due to new scoping rules, class variables (i.e. @@) defined
authored
2
d96da18 @dchelimsky words
authored
3 RSpec runs on Ruby 1.9.1 with the following caveats.
45981b6 @dchelimsky Ruby 1.9 - Due to new scoping rules, class variables (i.e. @@) defined
authored
4
73b104e @dchelimsky Ruby.1.9 info => rdoc
authored
5 == Test::Unit
45981b6 @dchelimsky Ruby 1.9 - Due to new scoping rules, class variables (i.e. @@) defined
authored
6
2e8ead0 @dchelimsky Ruby 1.9 compatiblity - use test-unit-1.2.3 for interop
authored
7 RSpec/Test::Unit interop will run with the test-unit-1.2.3 gem, but you must install it.
45981b6 @dchelimsky Ruby 1.9 - Due to new scoping rules, class variables (i.e. @@) defined
authored
8
73b104e @dchelimsky Ruby.1.9 info => rdoc
authored
9 == Class Variables
45981b6 @dchelimsky Ruby 1.9 - Due to new scoping rules, class variables (i.e. @@) defined
authored
10
11 Due to changes in scoping rules, class variables within example groups are not
12 supported in Ruby 1.9.
13
14 describe "a class variable" do
15 @@class_variable = "a class variable"
16
17 it "can access class variables in examples in Ruby 1.8" do
18 with_ruby 1.8 do
19 @@class_variable.should == "a class variable"
20 end
21 end
22
23 it "can NOT access class variables in examples in Ruby 1.9" do
24 with_ruby 1.9 do
25 lambda do
26 @@class_variable.should == "a class variable"
27 end.should raise_error(NameError)
28 end
29 end
30 end
31
Something went wrong with that request. Please try again.