Class: GraphWeaver::Testing::Config
- Inherits:
-
Object
- Object
- GraphWeaver::Testing::Config
- Defined in:
- lib/graph_weaver/testing.rb
Instance Attribute Summary collapse
-
#anonymize ⇒ Object
Returns the value of attribute anonymize.
-
#auto_fake ⇒ Object
Returns the value of attribute auto_fake.
-
#cassette_dir ⇒ Object
Returns the value of attribute cassette_dir.
-
#list_size ⇒ Object
Returns the value of attribute list_size.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#null_chance ⇒ Object
Returns the value of attribute null_chance.
-
#overrides ⇒ Object
Returns the value of attribute overrides.
-
#record ⇒ Object
Returns the value of attribute record.
-
#schema ⇒ Object
the explicitly configured schema, else the conventional dump (SchemaLoader.locate at GraphWeaver.schema_path) — nil when neither exists, which quietly disables auto_fake.
-
#seed ⇒ Object
Returns the value of attribute seed.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/graph_weaver/testing.rb', line 44 def initialize @overrides = {} @seed = nil @list_size = 1..3 @null_chance = 0.0 @mode = nil # auto @schema = nil @cassette_dir = "spec/cassettes" # explicit opt-in: swapping every example onto a fake is too # surprising to be a default — a little friction beats unexpected # behavior (the schema still auto-locates once you opt in) @auto_fake = false # GRAPHWEAVER_RECORD=1 rspec ... -> Cassette.use re-records @record = !ENV["GRAPHWEAVER_RECORD"].to_s.empty? # anonymize responses as they're recorded (needs config.schema) @anonymize = false end |
Instance Attribute Details
#anonymize ⇒ Object
Returns the value of attribute anonymize.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def anonymize @anonymize end |
#auto_fake ⇒ Object
Returns the value of attribute auto_fake.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def auto_fake @auto_fake end |
#cassette_dir ⇒ Object
Returns the value of attribute cassette_dir.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def cassette_dir @cassette_dir end |
#list_size ⇒ Object
Returns the value of attribute list_size.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def list_size @list_size end |
#mode ⇒ Object
Returns the value of attribute mode.
42 43 44 |
# File 'lib/graph_weaver/testing.rb', line 42 def mode @mode end |
#null_chance ⇒ Object
Returns the value of attribute null_chance.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def null_chance @null_chance end |
#overrides ⇒ Object
Returns the value of attribute overrides.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def overrides @overrides end |
#record ⇒ Object
Returns the value of attribute record.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def record @record end |
#schema ⇒ Object
the explicitly configured schema, else the conventional dump (SchemaLoader.locate at GraphWeaver.schema_path) — nil when neither exists, which quietly disables auto_fake
65 66 67 |
# File 'lib/graph_weaver/testing.rb', line 65 def schema @schema ||= GraphWeaver::SchemaLoader.locate end |
#seed ⇒ Object
Returns the value of attribute seed.
39 40 41 |
# File 'lib/graph_weaver/testing.rb', line 39 def seed @seed end |