Class: VerifiedDouble::ExampleMetadata

Inherits:
Struct
  • Object
show all
Defined in:
lib/verified_double/example_metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



2
3
4
# File 'lib/verified_double/example_metadata.rb', line 2

def 
  @metadata
end

Instance Method Details

#described_classObject



3
4
5
6
7
8
9
10
11
# File 'lib/verified_double/example_metadata.rb', line 3

def described_class
  if description.is_a?(Module)
    description
  elsif description.is_a?(String)
    ExampleMetadata.new([:example_group]).described_class
  else
    raise
  end
end

#descriptionObject



13
14
15
# File 'lib/verified_double/example_metadata.rb', line 13

def description
  [:description_args][0]
end

#method_signature_stringObject



17
18
19
20
21
22
23
24
25
# File 'lib/verified_double/example_metadata.rb', line 17

def method_signature_string
  if description =~ /^[\.\#]/
    description
  elsif description.nil?
    raise
  else
    ExampleMetadata.new([:example_group]).method_signature_string
  end
end

#verified_signatureObject



27
28
29
# File 'lib/verified_double/example_metadata.rb', line 27

def verified_signature
  "#{described_class}#{method_signature_string}"
end