In Files

Class Index [+]

Quicksearch

RSpec::Core

Builds command line arguments to pass to the rspec command over DRb

Public Class Methods

created_from_caller(other_caller) click to toggle source
    # File lib/rspec/core/shared_example_group.rb, line 42
42:           def self.created_from_caller(other_caller)
43:             @caller_line == other_caller.last
44:           end
included(kls) click to toggle source
    # File lib/rspec/core/shared_example_group.rb, line 46
46:           def self.included(kls)
47:             kls.describe(&@shared_block)
48:             kls.children.first.metadata[:shared_group_name] = name
49:           end

Public Instance Methods

share_as(name, &block) click to toggle source
    # File lib/rspec/core/shared_example_group.rb, line 32
32:       def share_as(name, &block)
33:         if Object.const_defined?(name)
34:           mod = Object.const_get(name)
35:           raise_name_error unless mod.created_from_caller(caller)
36:         end
37: 
38:         mod = Module.new do
39:           @shared_block = block
40:           @caller_line = caller.last
41: 
42:           def self.created_from_caller(other_caller)
43:             @caller_line == other_caller.last
44:           end
45: 
46:           def self.included(kls)
47:             kls.describe(&@shared_block)
48:             kls.children.first.metadata[:shared_group_name] = name
49:           end
50:         end
51: 
52:         shared_const = Object.const_set(name, mod)
53:         RSpec.world.shared_example_groups[shared_const] = block
54:       end

Private Instance Methods

ensure_shared_example_group_name_not_taken(name) click to toggle source
    # File lib/rspec/core/shared_example_group.rb, line 62
62:       def ensure_shared_example_group_name_not_taken(name)
63:         if RSpec.world.shared_example_groups.has_key?(name)
64:           raise ArgumentError.new("Shared example group '#{name}' already exists")
65:         end
66:       end
raise_name_error() click to toggle source
    # File lib/rspec/core/shared_example_group.rb, line 58
58:       def raise_name_error
59:         raise NameError, "The first argument (#{name}) to share_as must be a legal name for a constant not already in use."
60:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.