Sha256: 0e6f9fedac6dae848254ab259264a8a2469ac56c67fab32d761331c4ff5331ca

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

module Spec
  module Example
    class ExampleGroupSubclass < ExampleGroup
      class << self
        attr_accessor :examples_ran
      end

      @@class_variable = :class_variable
      CONSTANT = :constant

      before do
        @instance_variable = :instance_variable
      end
      
      after(:all) do
        self.class.examples_ran = true
      end

      it "should have access to instance variables" do
        @instance_variable.should == :instance_variable
      end

      it "should have access to class variables" do
        @@class_variable.should == :class_variable
      end

      it "should have access to constants" do
        CONSTANT.should == :constant
      end

      it "should have access to methods defined in the Example Group" do
        a_method.should == 22
      end
      
      def a_method
        22
      end
    end

    describe ExampleGroupSubclass do
      it "should run" do
        ExampleGroupSubclass.examples_ran.should be_true
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/example/example_group_class_definition_spec.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/example_group_class_definition_spec.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/example_group_class_definition_spec.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/example_group_class_definition_spec.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/example_group_class_definition_spec.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/example_group_class_definition_spec.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/example_group_class_definition_spec.rb
mack-0.8.2 lib/gems/rspec-1.1.11/spec/spec/example/example_group_class_definition_spec.rb
rspec-1.1.10 spec/spec/example/example_group_class_definition_spec.rb
rspec-1.1.11 spec/spec/example/example_group_class_definition_spec.rb
rspec-1.1.9 spec/spec/example/example_group_class_definition_spec.rb
typo-5.1.98 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
typo-5.2 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb