Module: Minitest::Assertions

Defined in:
lib/minitest/result_assertions.rb

Instance Method Summary collapse

Instance Method Details

#assert_error(exp, result) ⇒ Object

Fails unless exp is equal to error



24
25
26
# File 'lib/minitest/result_assertions.rb', line 24

def assert_error(exp, result)
  assert_equal(exp, result.error)
end

#assert_failure(result) ⇒ Object

Fails unless Result is a Failure



14
15
16
# File 'lib/minitest/result_assertions.rb', line 14

def assert_failure(result)
  assert_kind_of(Typed::Failure, result)
end

#assert_payload(exp, result) ⇒ Object

Fails unless exp is equal to payload



19
20
21
# File 'lib/minitest/result_assertions.rb', line 19

def assert_payload(exp, result)
  assert_equal(exp, result.payload)
end

#assert_success(result) ⇒ Object

Fails unless Result is a Success



9
10
11
# File 'lib/minitest/result_assertions.rb', line 9

def assert_success(result)
  assert_kind_of(Typed::Success, result)
end

#refute_error(exp, result) ⇒ Object

Fails if exp is equal to error



44
45
46
# File 'lib/minitest/result_assertions.rb', line 44

def refute_error(exp, result)
  refute_equal(exp, result.error)
end

#refute_failure(result) ⇒ Object

Fails if Result is a Failure



34
35
36
# File 'lib/minitest/result_assertions.rb', line 34

def refute_failure(result)
  refute_kind_of(Typed::Failure, result)
end

#refute_payload(exp, result) ⇒ Object

Fails if exp is equal to payload



39
40
41
# File 'lib/minitest/result_assertions.rb', line 39

def refute_payload(exp, result)
  refute_equal(exp, result.payload)
end

#refute_success(result) ⇒ Object

Fails if Result is a Success



29
30
31
# File 'lib/minitest/result_assertions.rb', line 29

def refute_success(result)
  refute_kind_of(Typed::Success, result)
end