Class: Obsidian::Spec::SupersetMatcher

Inherits:
Object
  • Object
show all
Includes:
Obsidian::Spec
Defined in:
lib/obsidian/spec/set_spec_helper.rb

Instance Method Summary collapse

Methods included from Obsidian::Spec

#args_to_set, #find_calling_line, #read_calling_line

Constructor Details

#initialize(object) ⇒ SupersetMatcher

Returns a new instance of SupersetMatcher.



22
23
24
# File 'lib/obsidian/spec/set_spec_helper.rb', line 22

def initialize(object)
  @object = object.to_set
end

Instance Method Details

#of(*other) ⇒ Object



25
26
27
28
# File 'lib/obsidian/spec/set_spec_helper.rb', line 25

def of(*other)
  other = args_to_set(*other)
  assert(@object.proper_superset?(other) || @object==other, "Expected #{@object.inspect} to be a superset of #{other.inspect}")
end