class RSpec::Cheki::Matchers::MatchSnapshot
Attributes
example[R]
snapshot[R]
Public Class Methods
new()
click to toggle source
# File lib/rspec/cheki/matchers/match_snapshot.rb, line 10 def initialize @example = RSpec.current_example @snapshot = RSpec::Cheki::Manager.create_snapshot(example: example) end
Public Instance Methods
description()
click to toggle source
# File lib/rspec/cheki/matchers/match_snapshot.rb, line 19 def description "match stored snapshot" end
diffable?()
click to toggle source
# File lib/rspec/cheki/matchers/match_snapshot.rb, line 28 def diffable? true end
failure_message()
click to toggle source
# File lib/rspec/cheki/matchers/match_snapshot.rb, line 15 def failure_message "received value does not match stored snapshot #{snapshot.key}" end
matches?(actual)
click to toggle source
# File lib/rspec/cheki/matchers/match_snapshot.rb, line 23 def matches?(actual) snapshot.actual = actual snapshot.match? end