Module Spec::Example::BeforeAndAfterHooks

  1. lib/spec/example/before_and_after_hooks.rb

Public class methods

after_suite_parts ()
[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 9
        def after_suite_parts
          @after_suite_parts ||= []
        end
before_suite_parts ()
[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 5
        def before_suite_parts
          @before_suite_parts ||= []
        end

Public instance methods

after (*args, &block)

Alias for prepend_after

after_suite_parts ()
[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 60
      def after_suite_parts
        BeforeAndAfterHooks.after_suite_parts
      end
append_after (*args, &block)

Registers a block to be executed after each example. This method appends block to existing after blocks.

[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 36
      def append_after(*args, &block)
        after_parts(*args) << block
      end
append_before (*args, &block)

Registers a block to be executed before each example. This method appends block to existing before blocks.

[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 22
      def append_before(*args, &block)
        before_parts(*args) << block
      end
before (*args, &block)

Alias for append_before

before_suite_parts ()
[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 56
      def before_suite_parts
        BeforeAndAfterHooks.before_suite_parts
      end
prepend_after (*args, &block)

Registers a block to be executed after each example. This method prepends block to existing after blocks.

[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 29
      def prepend_after(*args, &block)
        after_parts(*args).unshift(block)
      end
prepend_before (*args, &block)

Registers a block to be executed before each example. This method prepends block to existing before blocks.

[show source]
# File lib/spec/example/before_and_after_hooks.rb, line 16
      def prepend_before(*args, &block)
        before_parts(*args).unshift(block)
      end