Class: Obsidian::Spec::SubsetMatcher
- Inherits:
-
Object
- Object
- Obsidian::Spec::SubsetMatcher
- Includes:
- Obsidian::Spec
- Defined in:
- lib/obsidian/spec/set_spec_helper.rb
Instance Method Summary collapse
-
#initialize(object) ⇒ SubsetMatcher
constructor
A new instance of SubsetMatcher.
- #of(*other) ⇒ Object
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 |