You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cyril Kato edited this page Nov 1, 2026
·
2 revisions
expect wraps a value, or a block whose value or exception the matcher judges; to passes when the matcher matches, not_to when it does not. Each expectation writes one line, with the actual value as its inspect wrote it.
$ ruby spec/expectation_spec.rbspec/expectation_spec.rb:4: Success: expected false not to be truespec/expectation_spec.rb:5: Success: expected "foo" to eq "foo"spec/expectation_spec.rb:6: Success: expected #<ZeroDivisionError: divided by 0> to raise exception ZeroDivisionError