Module: GraphWeaver::Testing
- Defined in:
- lib/graph_weaver/rspec.rb,
lib/graph_weaver/testing.rb,
lib/graph_weaver/testing/failure.rb,
lib/graph_weaver/testing/cassette.rb
Defined Under Namespace
Modules: Failure, RSpecIntegration Classes: Anonymizer, Cassette, Config, FailureClient, FakeClient, MissingRecording, Recorder, Replayer, Sequence, Values
Constant Summary collapse
- MODES =
[:faker, :literal].freeze
Class Method Summary collapse
-
.cassette_path(name) ⇒ Object
resolve a cassette name ("github") against cassette_dir; paths with separators or extensions pass through.
- .config ⇒ Object
- .configure {|config| ... } ⇒ Object
-
.reset! ⇒ Object
back to defaults — between tests, or to undo an experiment.
Class Method Details
.cassette_path(name) ⇒ Object
resolve a cassette name ("github") against cassette_dir; paths with separators or extensions pass through
94 95 96 97 98 |
# File 'lib/graph_weaver/testing.rb', line 94 def cassette_path(name) return name if name.include?("/") || name.end_with?(".yml", ".yaml") File.join(config.cassette_dir, "#{name}.yml") end |
.config ⇒ Object
79 80 81 |
# File 'lib/graph_weaver/testing.rb', line 79 def config @config ||= Config.new end |
.configure {|config| ... } ⇒ Object
83 84 85 |
# File 'lib/graph_weaver/testing.rb', line 83 def configure yield config end |
.reset! ⇒ Object
back to defaults — between tests, or to undo an experiment
88 89 90 |
# File 'lib/graph_weaver/testing.rb', line 88 def reset! @config = nil end |