Sha256: 50511207a86332eed18ee60737ce4618be365ca7e238c78eda06a8ce297dbcba

Contents?: true

Size: 1013 Bytes

Versions: 45

Compression:

Stored size: 1013 Bytes

Contents

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

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

      @@klass_variable_set = true
      CONSTANT = :foobar

      before do
        @instance_variable = :hello
      end

      it "should run" do
        self.class.examples_ran = true
      end

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

      it "should have access to class variables" do
        @@klass_variable_set.should == true
      end

      it "should have access to constants" do
        CONSTANT.should == :foobar
      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

45 entries across 45 versions & 7 rubygems

Version Path
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.6 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.7 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
picolena-0.1.8 rails_plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
pictrails-0.5.0 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
radiant-0.6.5 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
radiant-0.6.6 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
radiant-0.6.7 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb
radiant-0.6.8 vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb