Class: Museo::Snapshot
- Inherits:
-
Object
- Object
- Museo::Snapshot
- Defined in:
- lib/museo/snapshot.rb,
lib/museo/snapshot/rspec.rb,
lib/museo/snapshot/minitest.rb
Defined Under Namespace
Classes: GenerationDisabledError, Minitest, Rspec
Class Method Summary collapse
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(klass:, test_name:, response:) ⇒ Snapshot
constructor
A new instance of Snapshot.
Constructor Details
#initialize(klass:, test_name:, response:) ⇒ Snapshot
Returns a new instance of Snapshot.
15 16 17 18 19 20 21 |
# File 'lib/museo/snapshot.rb', line 15 def initialize(klass:, test_name:, response:) @class_name = klass.to_s @test_name = test_name @response = response generate unless exists? end |
Class Method Details
.sanitize_response(body) ⇒ Object
10 11 12 |
# File 'lib/museo/snapshot.rb', line 10 def sanitize_response(body) body.gsub(/:0x[a-fA-F0-9]{4,}/, ":0xXXXXXX") end |
Instance Method Details
#body ⇒ Object
23 24 25 |
# File 'lib/museo/snapshot.rb', line 23 def body exists? ? File.read(path) : nil end |