Sha256: 22eb91675b29d5fe98d5084947cda5a95aaf80e8ac206dec34eaf5c0659953b8

Contents?: true

Size: 1.44 KB

Versions: 51

Compression:

Stored size: 1.44 KB

Contents

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

module Spec
  module Example
    describe 'Nested Example Groups' do
      parent = self
      
      def count
        @count ||= 0
        @count = @count + 1
        @count
      end

      before(:all) do
        count.should == 1
      end

      before(:all) do
        count.should == 2
      end

      before(:each) do
        count.should == 3
      end

      before(:each) do
        count.should == 4
      end

      it "should run before(:all), before(:each), example, after(:each), after(:all) in order" do
        count.should == 5
      end

      after(:each) do
        count.should == 7
      end

      after(:each) do
        count.should == 6
      end

      after(:all) do
        count.should == 9
      end

      after(:all) do
        count.should == 8
      end

      describe 'nested example group' do
        self.superclass.should == parent
        
        it "should run all before and after callbacks" do
          count.should == 5
        end
      end
    end

    describe "Nested Example Groups" do
      describe "description options", :other_options => "other options" do
        it "should have a spec_path" do
          self.class.description_options[:spec_path].should match(/#{__FILE__}/)
        end

        it "should pass other options" do
          self.class.description_options[:other_options].should == "other options"
        end
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 11 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11.1 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/example/nested_example_group_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/example/nested_example_group_spec.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
newbamboo-evented-rspec-1.1.12 spec/spec/example/nested_example_group_spec.rb
newbamboo-rspec-1.1.12 spec/spec/example/nested_example_group_spec.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/nested_example_group_spec.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/nested_example_group_spec.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/nested_example_group_spec.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/example/nested_example_group_spec.rb