Sha256: adce6be535cddca97f2af1689b6eb5812f8231dbfab889e11a3dae54cb1a4336

Contents?: true

Size: 879 Bytes

Versions: 10

Compression:

Stored size: 879 Bytes

Contents

module Rspec
  module Core
    module Advice
      def before_blocks
        @before_blocks ||= { :all => [], :each => [] }
      end

      def after_blocks
        @after_blocks  ||= { :all => [], :each => [] }
      end

      def around_blocks
        @around_blocks ||= { :each => [] }
      end

      def before_eachs
        before_blocks[:each]
      end

      def before_alls
        before_blocks[:all]
      end

      def before(type=:each, &block)
        before_blocks[type] << block
      end

      def after_eachs
        after_blocks[:each]
      end

      def after_alls
        after_blocks[:all]
      end

      def after(type=:each, &block)
        after_blocks[type] << block
      end

      def around_eachs
        around_blocks[:each]
      end

      def around(type=:each, &block)
        around_blocks[type] << block
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.1 lib/rspec/core/advice.rb
rspec-core-2.0.0.a10 lib/rspec/core/advice.rb
rspec-core-2.0.0.a9 lib/rspec/core/advice.rb
rspec-core-2.0.0.a8 lib/rspec/core/advice.rb
rspec-core-2.0.0.a7 lib/rspec/core/advice.rb
rspec-core-2.0.0.a6 lib/rspec/core/advice.rb
rspec-core-2.0.0.a5 lib/rspec/core/advice.rb
rspec-core-2.0.0.a4 lib/rspec/core/advice.rb
rspec-core-2.0.0.a3 lib/rspec/core/advice.rb
rspec-core-2.0.0.a2 lib/rspec/core/advice.rb