smtlaissezfaire / rspec forked from dchelimsky/rspec

Behaviour Driven Development framework for Ruby

This URL has Read+Write access

dchelimsky (author)
Sat Aug 29 15:25:25 -0700 2009
commit  0b333bf1277e9fa9419978b903dc182fb8c88cf1
tree    aebb9857692ffecdb12331bcf35e85eca75b7728
parent  6af63b178f4b023eedf60d349ffa914997622ebe
rspec / Ruby1.9.rdoc
100644 33 lines (23 sloc) 0.901 kb

RSpec and Ruby 1.9

Currently, RSpec (core) is mostly compatible with Ruby 1.9.1. There are still outstanding issues, some of which we plan to address and some we don’t.

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