assertEqual(first, second)
assertNotEqual(first, second)
assertAlmostEqual(first, second, delta=none)
assertListEqual(first, second)
assertTupleEqual(first, second)
assertDictEqual(first, second)
assertCountEqual(first, second)
assertGreater(first, second)
assertGreaterEqual(first, second)
assertLess(first, second)
assertLessEqual(first, second)
assertIs(first, second)
assertIn(member, container)
assertTrue(condition)
assertFalse(condition)
assertListEqual()
instead of just assertEqual()
? Well, they are designed to show the difference between the two values on failure. So students will receive more accurate feedback if you use the proper assertion.assertEquals(expected, actual)
assertEquals(expected, actual, delta)
- for doublesassertArrayEquals(expecteds, actuals)
assertNotNull(object)
assertNull(object)
assertNotSame(unexpected, actual)
assertSame(unexpected, actual)
assertTrue(condition)
assertFalse(condition)
expect([]).to be_empty
expect([]).not_to be_empty
expect("a string").to be_an_instance_of(String)
expect(3).to be_a_kind_of(Integer)
expect(3).to be_a_kind_of(Numeric)
expect(3).to be_an_instance_of(Integer)
expect(3).not_to be_an_instance_of(Numeric)
expect(5).to eq(5)
expect(5).not_to eq(3)
expect { print 'foo' }.to output('foo').to_stdout
expect(5).to satisfy { |n| n > 3 }
expect(5).to satisfy("be greater than 3") { |n| n > 3 }