Module Spec::DSL::BehaviourCallbacks
In: lib/spec/dsl/behaviour_callbacks.rb

Methods

Public Instance methods

[Source]

    # File lib/spec/dsl/behaviour_callbacks.rb, line 30
30:       def add(scope, options, where, how, &block)
31:         scope ||= :each
32:         options ||= {}
33:         behaviour_type = options[:behaviour_type]
34:         case scope
35:           when :each; self.__send__("#{where}_each_parts", behaviour_type).__send__(how, block)
36:           when :all;  self.__send__("#{where}_all_parts", behaviour_type).__send__(how, block)
37:         end
38:       end
after(*args, &block)

Alias for prepend_after

[Source]

    # File lib/spec/dsl/behaviour_callbacks.rb, line 20
20:       def append_after(*args, &block)
21:         scope, options = scope_and_options(*args)
22:         add(scope, options, :after, :<<, &block)
23:       end

[Source]

    # File lib/spec/dsl/behaviour_callbacks.rb, line 9
 9:       def append_before(*args, &block)
10:         scope, options = scope_and_options(*args)
11:         add(scope, options, :before, :<<, &block)
12:       end
before(*args, &block)

Alias for append_before

[Source]

    # File lib/spec/dsl/behaviour_callbacks.rb, line 15
15:       def prepend_after(*args, &block)
16:         scope, options = scope_and_options(*args)
17:         add(scope, options, :after, :unshift, &block)
18:       end

[Source]

   # File lib/spec/dsl/behaviour_callbacks.rb, line 5
5:       def prepend_before(*args, &block)
6:         scope, options = scope_and_options(*args)
7:         add(scope, options, :before, :unshift, &block)
8:       end

[Source]

    # File lib/spec/dsl/behaviour_callbacks.rb, line 25
25:       def scope_and_options(*args)
26:         args, options = args_and_options(*args)
27:         scope = (args[0] || :each), options
28:       end

Deprecated. Use before(:each)

[Source]

    # File lib/spec/dsl/behaviour_callbacks.rb, line 41
41:       def setup(&block)
42:         before(:each, &block)
43:       end

Deprecated. Use after(:each)

[Source]

    # File lib/spec/dsl/behaviour_callbacks.rb, line 46
46:       def teardown(&block)
47:         after(:each, &block)
48:       end

[Validate]