Class: RubyEventStore::RSpec::BeEvent::DataMatcher
- Inherits:
-
Object
- Object
- RubyEventStore::RSpec::BeEvent::DataMatcher
- Defined in:
- lib/ruby_event_store/rspec/be_event.rb
Instance Method Summary collapse
-
#initialize(expected, strict:) ⇒ DataMatcher
constructor
A new instance of DataMatcher.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(expected, strict:) ⇒ DataMatcher
Returns a new instance of DataMatcher.
17 18 19 20 |
# File 'lib/ruby_event_store/rspec/be_event.rb', line 17 def initialize(expected, strict:) @strict = strict @expected = expected end |
Instance Method Details
#matches?(actual) ⇒ Boolean
22 23 24 25 26 |
# File 'lib/ruby_event_store/rspec/be_event.rb', line 22 def matches?(actual) return true unless @expected matcher = @strict ? ::RSpec::Matchers::BuiltIn::Match : ::RSpec::Matchers::BuiltIn::Include matcher.new(@expected).matches?(actual) end |