Module: Fixtures::Symbol
- Extended by:
- Symbol
- Includes:
- Fixtures
- Included in:
- Symbol
- Defined in:
- lib/data_model/fixtures/symbol.rb
Overview
Test data around symbol schemas
Instance Method Summary collapse
-
#exclusion ⇒ Example
a symbol example where :invalid is the only disallowed Symbol.
-
#inclusion ⇒ Example
a symbol example where :valid is the only allowed Symbol.
-
#optional ⇒ Example
a symbol example that is optional.
-
#simple ⇒ Example
a simple symbol example.
Instance Method Details
#exclusion ⇒ Example
a symbol example where :invalid is the only disallowed Symbol
48 49 50 51 52 53 54 55 56 |
# File 'lib/data_model/fixtures/symbol.rb', line 48 def exclusion Example.new( [:symbol, { excluded: [:invalid] }], variants: { valid: :valid, inside: :invalid }, ) end |
#inclusion ⇒ Example
a symbol example where :valid is the only allowed Symbol
36 37 38 39 40 41 42 43 44 |
# File 'lib/data_model/fixtures/symbol.rb', line 36 def inclusion Example.new( [:symbol, { included: [:valid] }], variants: { valid: :valid, outside: :outside }, ) end |
#optional ⇒ Example
a symbol example that is optional
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/data_model/fixtures/symbol.rb', line 23 def optional Example.new( [:symbol, { optional: true }], variants: { missing: nil, present: :valid, number: 22 }, ) end |
#simple ⇒ Example
a simple symbol example
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/data_model/fixtures/symbol.rb', line 9 def simple Example.new( [:symbol], variants: { valid: :valid, coerce: "valid", missing: nil, other_type: 22 }, ) end |