Module: MiniSpecMetadata::SpecWithMetadata

Defined in:
lib/minispec-metadata/spec_with_metadata.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(spec_class) ⇒ Object



4
5
6
# File 'lib/minispec-metadata/spec_with_metadata.rb', line 4

def self.included(spec_class)
  spec_class.extend(ClassMethods)
end

Instance Method Details

#metadataObject



39
40
41
42
# File 'lib/minispec-metadata/spec_with_metadata.rb', line 39

def 
   = self.class.class_variable_get(:@@metadata).fetch(name, {})
  .merge 
end

#spec_additional_descriptionObject



59
60
61
# File 'lib/minispec-metadata/spec_with_metadata.rb', line 59

def spec_additional_description
  self.class.spec_additional_description
end

#spec_descriptionObject



55
56
57
# File 'lib/minispec-metadata/spec_with_metadata.rb', line 55

def spec_description
  self.class.desc
end

#spec_descriptionsObject

Description args passed to describe. Additional description is included if given.



51
52
53
# File 'lib/minispec-metadata/spec_with_metadata.rb', line 51

def spec_descriptions
  [spec_description, spec_additional_description].compact
end

#spec_nameObject

First arg passed to it block.



45
46
47
# File 'lib/minispec-metadata/spec_with_metadata.rb', line 45

def spec_name
  self.class.class_variable_get(:@@spec_names)[name]
end