Module: UnifiedMatchers::Assertions

Defined in:
lib/unified_matchers/assertions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#matcherObject

Returns the value of attribute matcher.



10
11
12
# File 'lib/unified_matchers/assertions.rb', line 10

def matcher
  @matcher
end

Instance Method Details

#assert_data_kind_of(ref, my, aClass) ⇒ Object



22
23
24
25
26
27
# File 'lib/unified_matchers/assertions.rb', line 22

def assert_data_kind_of ref, my, aClass
  assert_nothing_raised { @my_matcher_results = matcher[ref, my] }
  @my_matcher_results.each do |r|
    assert_kind_of aClass, r.data, r.to_s
  end
end

#assert_failure(ref, my) ⇒ Object



17
18
19
20
# File 'lib/unified_matchers/assertions.rb', line 17

def assert_failure ref, my
  assert_nothing_raised { @my_matcher_results = matcher[ref, my] }
  assert @my_matcher_results.failure?, @my_matcher_results.to_s
end

#assert_message_equal(ref, my, aMessage) ⇒ Object



29
30
31
32
33
34
# File 'lib/unified_matchers/assertions.rb', line 29

def assert_message_equal ref, my, aMessage
  assert_nothing_raised { @my_matcher_results = matcher[ref, my] }
  @my_matcher_results.each do |r|
    assert_equal aMessage, r.message, r.name
  end
end

#assert_success(ref, my) ⇒ Object



12
13
14
15
# File 'lib/unified_matchers/assertions.rb', line 12

def assert_success ref, my
  assert_nothing_raised { @my_matcher_results = matcher[ref, my] }
  assert @my_matcher_results.success?, @my_matcher_results.to_s
end