Sha256: 7459bf42a0386b5a45638fd439972f4a7aa5628aa218081d6acab57585327868

Contents?: true

Size: 1.12 KB

Versions: 14

Compression:

Stored size: 1.12 KB

Contents

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

module Spec
  module Example
    class ExampleGroupSubclass < ExampleGroup
      def self.examples_ran
        @examples_ran
      end

      def self.examples_ran=(examples_ran)
        @examples_ran = 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 & 3 rubygems

Version Path
dchelimsky-rspec-1.1.11.1 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/example/example_group_class_definition_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/example/example_group_class_definition_spec.rb
rspec-1.1.12 spec/spec/example/example_group_class_definition_spec.rb
spree-0.6.0 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
spree-0.7.1 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
spree-0.7.0 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
spree-0.8.0 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
spree-0.8.1 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb