aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/plugins/rspec/Ruby1.9.rdoc
blob: e42cc85e433b74080d022cfaeabee97fea253dd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
= RSpec and Ruby 1.9

RSpec runs on Ruby 1.9.1 with the following caveats.

== Test::Unit

RSpec/Test::Unit interop will run with the test-unit-1.2.3 gem, but you must install it.

== Class Variables

Due to changes in scoping rules, class variables within example groups are not
supported in Ruby 1.9.

    describe "a class variable" do
      @@class_variable = "a class variable"
  
      it "can access class variables in examples in Ruby 1.8" do
        with_ruby 1.8 do
          @@class_variable.should == "a class variable"
        end
      end
  
      it "can NOT access class variables in examples in Ruby 1.9" do
        with_ruby 1.9 do
          lambda do
            @@class_variable.should == "a class variable"
          end.should raise_error(NameError)
        end
      end
    end