Class: Obsidian::Spec::SubsetMatcher

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) ⇒ SubsetMatcher

Returns a new instance of SubsetMatcher.



12
13
14
# File 'lib/obsidian/spec/set_spec_helper.rb', line 12

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

Instance Method Details

#of(*other) ⇒ Object



15
16
17
18
# File 'lib/obsidian/spec/set_spec_helper.rb', line 15

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