Module: NRSER::RSpex
- Defined in:
- lib/nrser/rspex.rb,
lib/nrser/rspex/shared_examples.rb
Defined Under Namespace
Modules: Example, ExampleGroup, SharedExamples Classes: Args, List, Opts
Constant Summary collapse
- PREFIXES_BASE =
{ section: '§', group: '•', invocation: '⟮⟯', }
- PREFIXES_MATH_ITALIC =
PREFIXES_BASE.merge( module: '𝑀', method: '𝑚', class: '𝐶', attribute: '𝑎', file: '𝐹', )
- PREFIXES_MATH_CURSIVE_WORDS =
PREFIXES_BASE.merge( module: '𝓜 𝓸𝓭𝓾𝓵𝓮', method: '𝓶𝓮𝓽', class: '𝐶', attribute: '𝑎', file: '𝐹', )
- PREFIXES =
PREFIXES_MATH_GREEK = PREFIXES_BASE.merge(
# module: "𝓜 𝓸𝓭𝓾𝓵𝓮", module: '𝛭', method: '𝜆', class: '𝛤', attribute: '𝛼',)
PREFIXES_MATH_ITALIC
Class Method Summary collapse
- .format(*parts, type: nil) ⇒ return_type
- .format_type(type, description) ⇒ return_type
- .short_s(value, max = 64) ⇒ return_type
Class Method Details
.format(*parts, type: nil) ⇒ return_type
TODO:
Document format method.
Returns @todo Document return value.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/nrser/rspex.rb', line 191 def self.format *parts, type: nil format_type \ type, parts. map { |part| if part.respond_to? :to_desc part.to_desc elsif part.is_a? String part else short_s part end }. join( ' ' ) end |
.format_type(type, description) ⇒ return_type
TODO:
Document format_type method.
Returns @todo Document return value.
173 174 175 176 177 178 179 |
# File 'lib/nrser/rspex.rb', line 173 def self.format_type type, description prefixes = RSpec.configuration.x_type_prefixes return description if type.nil? || !prefixes.key?( type ) "#{ prefixes[type] } #{ description }" end |
.short_s(value, max = 64) ⇒ return_type
TODO:
Document short_s method.
Returns @todo Document return value.
159 160 161 |
# File 'lib/nrser/rspex.rb', line 159 def self.short_s value, max = 64 NRSER.smart_ellipsis value.inspect, max end |