Sha256: 0a74a515a01c02ab478c0adbd47fa1aa57fd36d0424554e03f12d6805f540925

Contents?: true

Size: 1.04 KB

Versions: 21

Compression:

Stored size: 1.04 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
  end
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb
rspec-1.1.1 spec/spec/example/nested_example_group_spec.rb
rspec-1.1.0 spec/spec/example/nested_example_group_spec.rb
rspec-1.1.3 spec/spec/example/nested_example_group_spec.rb
rspec-1.1.2 spec/spec/example/nested_example_group_spec.rb
spree-0.2.0 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.0.1 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.0.2 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.0.3.98.1 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.0.3.98 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.0 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.1.2 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.1.1 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb
typo-5.1.3 vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb