Same test in Rspec, capybara, cucumber

I’m having difficulties with understanding testing. Please, how do I
write tests in rspec, capybara, or cucumber for case 1 and case 2
(arguably only for learning)

Case 1:

test: c should be 16.

8 + 8 = c

Case 2:

test: if a,b = 8; or 1 and 7, c should be 16.

a + b = c

Case 2 is more important, if you could write the syntax for all three
test systems, that would be great.

Many thanks in advance!